|
Re: PyMSNt Screenname for Google Talk users: msg#00155network.jabber.py-transports
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 >>> I promised it to write a little patch for it, and so here it is. >> You attached not patch but not unified diff output. >> Re-do the same with -u key to get a patch: >> diff -u >somefile.diff Ah ok :) > > also it looks like you've done a reverse patch. The 'old file' should > be the first file, and the 'new file' should be the second file on the > command line. > Whoops So here the correct one Maarten -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) iD8DBQFEFrsaXjGr8JbE19URAvWZAKDnG90ACshBOtwKl50mIAJKxmBnewCgqIdy sJ4ltDzkCNr8skb+yDxVQLI= =TBwA -----END PGP SIGNATURE----- --- /root/PyMSN/src/session.py 2006-03-14 12:22:59.000000000 +0100 +++ /usr/local/PyMSNt/src/session.py 2006-03-14 12:45:05.000000000 +0100 @@ -48,6 +48,7 @@ self.username = username # the legacy network ID of the Session's user self.password = password self.nickname = "" + self.fullname = "" self.avatar = None self.lang = ulang @@ -121,6 +122,8 @@ for e in vCard.elements(): if e.name == "NICKNAME": self.updateNickname(e.__str__()) + if e.name == "FN": + self.updateFullname(e.__str__()) if e.name == "PHOTO": imageData = avatar.parsePhotoEl(e) if not imageData: @@ -130,6 +133,14 @@ avatarSet = True if not avatarSet: self.legacycon.updateAvatar() # Default avatar + + if not self.nickname: + self.nickname = self.fullname.split()[0] #Use first name of Full Name if there is no nickname + if not self.nickname: + j = jid.intern(self.jabberID) #Otherwise use user part of JID + self.nickname = j.user + self.setStatus(self.show, self.status) + def errback(args=None): LogEvent(INFO, self.jabberID, "Error fetching avatar.") @@ -143,10 +154,9 @@ def updateNickname(self, nickname): self.nickname = nickname - if not self.nickname: - j = jid.intern(self.jabberID) - self.nickname = j.user - self.setStatus(self.show, self.status) + + def updateFullname(self, fullname): + self.fullname = fullname def setStatus(self, show, status): self.show = show _______________________________________________ py-transports mailing list py-transports@xxxxxxxxxxxxxxxxx http://www.modevia.com/cgi-bin/mailman/listinfo/py-transports |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Problems with PyMSNt + ejabberd-1.0.0: 00155, James Bunton |
|---|---|
| Next by Date: | Re: Problems with PyMSNt + ejabberd-1.0.0: 00155, Renato Botelho |
| Previous by Thread: | Re: PyMSNt Screenname for Google Talk usersi: 00155, Norman Rasmussen |
| Next by Thread: | Re: Re: PyMSNt Screenname for Google Talk users: 00155, James Bunton |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |