Oleg Motienko | 1 Aug 2005 02:16
Picon

PyICQ-t - Fix for xdb roster saving

Hello.

Here is a small patch for proper xdb roster saving. It seem like this 
patch fix problem when roster in xdb is cleared.

Also I saw such problem: people who use only icq2000 and older versions 
doesn't have buddies list on server, but cat have it in spool file of 
JIT. Does PyICQ-t check if uin from xdb is present in server list?

-- 
Regards,
Oleg
--- src/legacy/icqt.py	Mon Aug  1 03:37:50 2005
+++ src/legacy/icqt.py	Mon Aug  1 03:41:08 2005
 <at>  <at>  -730,17 +733,18  <at>  <at> 

 		newXDB = Element((None, "query"))
 		newXDB.namespace = "jabber:iq:roster"
+		newXDB.attributes["xmlns"] = "jabber:iq:roster"

 		for c in self.xdbcontacts:
 			try:
 				item = Element((None, "item"))
-				item.setAttribute("jid", c)
-				newXDB.appendChild(item)
+				item.attributes["jid"] = c
+				newXDB.addChild(item)

(Continue reading)

Daniel Henninger | 1 Aug 2005 03:18
Picon

Re: PyICQ-t - Fix for xdb roster saving

On Jul 31, 2005, at 8:16 PM, Oleg Motienko wrote:

> Hello.
>
> Here is a small patch for proper xdb roster saving. It seem like  
> this patch fix problem when roster in xdb is cleared.

Yarg.. Thanks for the patch!  What a dump thing for me to overlook.  ;)

> Also I saw such problem: people who use only icq2000 and older  
> versions doesn't have buddies list on server, but cat have it in  
> spool file of JIT. Does PyICQ-t check if uin from xdb is present in  
> server list?

I don't recall icq2000 or older having the capability to store  
contacts server side.  (I remember many a night of cussing when I had  
to reinstall or had a crash or something and had to re-find all my  
friends)

So there are two instances of ... if I'm reading this right ... this  
particular request:
If there are members in the XDB that aren't in your server side list,  
you still pay attention to them.  Don't necessarily subscribe to  
them, but at least watch for their presence.  Am I reading this  
right?  At present, PyICQ only pays attention to what's in your XDB  
list for the purposes of getting a feel for what's in your actual  
Jabber roster.  (in other words, if it doesn't find it in your XDB,  
it sends a "hey, you need to subscribe to this person's presence"  
stanza back to the jabber user)  If there's anything in your xdb list  
that isn't on your server side buddy list, it does not really care.   
(Continue reading)

Daniel Henninger | 1 Aug 2005 04:13
Picon

Re: PyICQ-t patch for detecting IP address

Hey Oleg, got a question for you.  I decided not to put this  
information in presence and instead put it in the DESC field in the  
VCARD similar to how JIT does.  I was wondering, however, if it's  
normal for a lot of this information to come in as all or mostly  
0's?  For example:

0.0.0.0/0.0.0.0(0) v.8
or
0.0.0.0/24.163.106.248:0 v.0

I'm going to commit the changes for now so others can play with it if  
they are interested, but i'm curious about these 0's and if they're  
normal.

Daniel

--

-- 
"The most addictive drug in the world is music."
      - The Lost Boyz

On Jul 30, 2005, at 2:01 PM, Oleg Motienko wrote:

> Hello,
>
> I try to make a patch for detecting IP and LAN IP addresses like in  
> JIT (changes in legacy/icqt.py and tlib/oscar.py).
> In JIT IP's detected and placed into DESC in VCARD.
> I put detected IP's into status presence but may be it's not good  
> idea?
>
(Continue reading)

Oleg Motienko | 1 Aug 2005 04:24
Picon

Re: PyICQ-t - Fix for xdb roster saving

On 8/1/05, Daniel Henninger <jadestorm <at> nc.rr.com> wrote:

> I don't recall icq2000 or older having the capability to store
> contacts server side.  (I remember many a night of cussing when I had
> to reinstall or had a crash or something and had to re-find all my
> friends)

This problem can appear if user roster in PyICQ-t spool and server
list is not in sync (after migrating from JIT for example).  At
present user has to resubscribe to missed icq contacts manually.

> So there are two instances of ... if I'm reading this right ... this
> particular request:
> If there are members in the XDB that aren't in your server side list,
> you still pay attention to them.  Don't necessarily subscribe to
> them, but at least watch for their presence.  Am I reading this
> right?  At present, PyICQ only pays attention to what's in your XDB
> list for the purposes of getting a feel for what's in your actual
> Jabber roster.  (in other words, if it doesn't find it in your XDB,
> it sends a "hey, you need to subscribe to this person's presence"
> stanza back to the jabber user)  If there's anything in your xdb list
> that isn't on your server side buddy list, it does not really care.
> (at present)

I think PyICQ-t must check XDB and server side buddy list
synchronization after reading list from server and after that add
missed uins to server list. This check can be placed in
B.gotBuddyList.

--

-- 
(Continue reading)

Oleg Motienko | 1 Aug 2005 04:29
Picon

Re: PyICQ-t patch for detecting IP address

Daniel Henninger wrote:

> Hey Oleg, got a question for you.  I decided not to put this information 
> in presence and instead put it in the DESC field in the VCARD similar to 
> how JIT does.  I was wondering, however, if it's normal for a lot of 
> this information to come in as all or mostly 0's?  For example:
> 
> 0.0.0.0/0.0.0.0(0) v.8
> or
> 0.0.0.0/24.163.106.248:0 v.0
> 
> I'm going to commit the changes for now so others can play with it if 
> they are interested, but i'm curious about these 0's and if they're normal.
> 

0.0.0.0 means user hide own IP (many clients support this).

I change patch a bit, put string into oscar.py
See attachment.

--
Oleg

diff -ur src/legacy/icqt.py src/legacy/icqt.py
--- src/legacy/icqt.py	Mon Aug  1 03:37:50 2005
+++ src/legacy/icqt.py	Mon Aug  1 04:21:48 2005
 <at>  <at>  -104,6 +104,7  <at>  <at> 
 		if (user.flags.count("away")):
(Continue reading)

Daniel Henninger | 1 Aug 2005 05:12
Picon

Re: Re: PyICQ-t patch for detecting IP address

Ok, no worries then.  I'm about to commit my changes.

Anyone interested in testing it out can check out SVN and pull a  
vcard of any particular user and you should see the ip address type  
information in the DESC/About field.

Daniel

-- 
"The most addictive drug in the world is music."
      - The Lost Boyz

On Jul 31, 2005, at 10:29 PM, Oleg Motienko wrote:

> Daniel Henninger wrote:
>
>
>> Hey Oleg, got a question for you.  I decided not to put this  
>> information in presence and instead put it in the DESC field in  
>> the VCARD similar to how JIT does.  I was wondering, however, if  
>> it's normal for a lot of this information to come in as all or  
>> mostly 0's?  For example:
>> 0.0.0.0/0.0.0.0(0) v.8
>> or
>> 0.0.0.0/24.163.106.248:0 v.0
>> I'm going to commit the changes for now so others can play with it  
>> if they are interested, but i'm curious about these 0's and if  
>> they're normal.
>>
>
(Continue reading)

Oleg Motienko | 1 Aug 2005 05:56
Picon

Patch for icqStatus

Hello,

Another patch, now icqStatus is displayed properly.

--
Oleg
--- src/legacy/icqt.py	Mon Aug  1 03:37:50 2005
+++ src/legacy/icqt.py	Mon Aug  1 07:37:53 2005
 <at>  <at>  -99,7 +99,7  <at>  <at> 
 		debug.log("B: updateBuddy %s" % (user))
 		buddyjid = icq2jid(user.name)
 		ptype = None
-		show = None
+		show = user.icqStatus
 		status = None
 		if (user.flags.count("away")):
 			self.getAway(user.name).addCallback(self.sendAwayPresence, user)
 <at>  <at>  -162,7 +162,12  <at>  <at> 

 		buddyjid = icq2jid(user.name)
 		ptype = None
-		show = "away"
+		show = user.icqStatus
+		if show == "busy":
+			show = "dnd"
+		if show == "unknown":
+			show = "away"
+		    
(Continue reading)

Oleg Motienko | 1 Aug 2005 06:12
Picon

Re: PyICQ-t patch for detecting IP address

Daniel Henninger wrote:
> Ok, no worries then.  I'm about to commit my changes.
> 
> Anyone interested in testing it out can check out SVN and pull a vcard 
> of any particular user and you should see the ip address type 
> information in the DESC/About field.
> 
> Daniel
> 

If I try to list vcard of user which never be online at this session, 
I've got:

 
desc.addContent("\n\n-----\n"+c['lanipaddr']+'/'+c['ipaddr']+':'+"%s"%(c['lanipport'])+' 
v.'+"%s"%(c['icqprotocol']))
exceptions.TypeError: cannot concatenate 'str' and 'NoneType' objects

I think it must be an additional check there.

--
Oleg
Oleg Motienko | 1 Aug 2005 10:24
Picon

Re: PyICQ-t patch for detecting IP address

Oleg Motienko wrote:
> Daniel Henninger wrote:
>> Ok, no worries then.  I'm about to commit my changes.
>>
>> Anyone interested in testing it out can check out SVN and pull a vcard 
>> of any particular user and you should see the ip address type 
>> information in the DESC/About field.
>>
>> Daniel
>>
> 
> If I try to list vcard of user which never be online at this session, 
> I've got:
> 
> 
> desc.addContent("\n\n-----\n"+c['lanipaddr']+'/'+c['ipaddr']+':'+"%s"%(c['lanipport'])+' 
> v.'+"%s"%(c['icqprotocol']))
> exceptions.TypeError: cannot concatenate 'str' and 'NoneType' objects
> 
> I think it must be an additional check there.
> 
see attachment
works ok for me

--
Oleg
--- src/legacy/icqt.py	Mon Aug  1 07:45:12 2005
+++ src/legacy/icqt.py	Mon Aug  1 12:11:07 2005
(Continue reading)

Sander Devrieze | 1 Aug 2005 10:30
Picon

Re: Re: PyICQ-t patch for detecting IP address

Op maandag 01 augustus 2005 04:29, schreef Oleg Motienko:
<snip>
> > I'm going to commit the changes for now so others can play with it if
> > they are interested, but i'm curious about these 0's and if they're
> > normal.
>
> 0.0.0.0 means user hide own IP (many clients support this).

Idea: if the user hide his IP, 0.0.0.0 is replaced by the transport with the 
text "User hides his IP".

--

-- 
Mvg, Sander Devrieze.

xmpp:sander <at> l4l.be ( http://jabber.tk/ )
_______________________________________________
py-transports mailing list
py-transports <at> blathersource.org
http://www.modevia.com/cgi-bin/mailman/listinfo/py-transports

Gmane