+ def contactStatusChanged(self, remoteUser):
+ LogEvent(INFO, self.jabberID)
+
+ msnContact = self.getContacts().getContact(remoteUser)
+ c = self.session.contactList.findContact(msn2jid(remoteUser, False))
+ if not (c and msnContact): return
+
+ show, ptype = state2presence(msnContact.status)
+ status = msnContact.personal.decode("utf-8", "replace")
+ screenName = msnContact.screenName.decode("utf-8", "replace")
+
+ c.updateNickname(screenName, push=False)
+ c.updatePresence(show, status, ptype, force=True)
+
+ def gotFileReceive(self, fileReceive):
+ LogEvent(INFO, self.jabberID)
+ # FIXME
+ ft.FTReceive(self.session, msn2jid(fileReceive.userHandle, True), fileReceive)
+
+ def contactAddedMe(self, userHandle):
+ LogEvent(INFO, self.jabberID)
+ self.session.contactList.getContact(msn2jid(userHandle, False)).contactRequestsAuth()
+
+ def contactRemovedMe(self, userHandle):
+ LogEvent(INFO, self.jabberID)
+ c = self.session.contactList.getContact(msn2jid(userHandle, True))
+ c.contactDerequestsAuth()
+ c.contactRemovesAuth()
+
+ def gotInitialEmailNotification(self, inboxunread, foldersunread):
+ if config.mailNotifications:
+ LogEvent(INFO, self.jabberID)
+ text = lang.get(self.session.lang).msnInitialMail % (inboxunread, foldersunread)
+ self.session.sendMessage(to=self.jabberID, fro=config.jid, body=text, mtype="headline")
+
+ def gotRealtimeEmailNotification(self, mailfrom, fromaddr, subject):
+ if config.mailNotifications:
+ LogEvent(INFO, self.jabberID)
+ text = lang.get(self.session.lang).msnRealtimeMail % (mailfrom, fromaddr, subject)
+ self.session.sendMessage(to=self.jabberID, fro=config.jid, body=text, mtype="headline")
+
+ def gotMSNAlert(self, text, actionurl, subscrurl):
+ LogEvent(INFO, self.jabberID)
+
+ el = Element((None, "message"))
+ el.attributes["to"] = self.jabberID
+ el.attributes["from"] = config.jid
+ el.attributes["type"] = "headline"
+ body = el.addElement("body")
+ body.addContent(text)
+
+ x = el.addElement("x")
+ x.attributes["xmlns"] = "jabber:x:oob"
+ x.addElement("desc").addContent("More information on this notice.")
+ x.addElement("url").addContent(actionurl)
+
+ x = el.addElement("x")
+ x.attributes["xmlns"] = "jabber:x:oob"
+ x.addElement("desc").addContent("Manage subscriptions to alerts.")
+ x.addElement("url").addContent(subscrurl)
+
+ self.session.pytrans.send(el)