comparison frontends/src/quick_frontend/quick_app.py @ 507:f98bef71a918

frontends, core, plugin XEP-0045: leave implementation + better nick change - memory: individual entity cache can be deleted - plugin XEP-0045: nick change are now detected and userChangedNick signal is sent instead of joined/left - plugin XEP-0045: leave implementation - frontends: userChangedNick signal management - Primitivus: an alert is shown in notification bar in case of error in sendMessage
author Goffi <goffi@goffi.org>
date Fri, 28 Sep 2012 00:26:24 +0200
parents 65ecbb473cbb
children 886754295efe
comparison
equal deleted inserted replaced
506:2e43c74815ad 507:f98bef71a918
55 self.bridge.register("entityDataUpdated", self.entityDataUpdated) 55 self.bridge.register("entityDataUpdated", self.entityDataUpdated)
56 self.bridge.register("askConfirmation", self.askConfirmation) 56 self.bridge.register("askConfirmation", self.askConfirmation)
57 self.bridge.register("actionResult", self.actionResult) 57 self.bridge.register("actionResult", self.actionResult)
58 self.bridge.register("actionResultExt", self.actionResult) 58 self.bridge.register("actionResultExt", self.actionResult)
59 self.bridge.register("roomJoined", self.roomJoined, "plugin") 59 self.bridge.register("roomJoined", self.roomJoined, "plugin")
60 self.bridge.register("roomLeft", self.roomLeft, "plugin")
60 self.bridge.register("roomUserJoined", self.roomUserJoined, "plugin") 61 self.bridge.register("roomUserJoined", self.roomUserJoined, "plugin")
61 self.bridge.register("roomUserLeft", self.roomUserLeft, "plugin") 62 self.bridge.register("roomUserLeft", self.roomUserLeft, "plugin")
63 self.bridge.register("roomUserChangedNick", self.roomUserChangedNick, "plugin")
62 self.bridge.register("roomNewSubject", self.roomNewSubject, "plugin") 64 self.bridge.register("roomNewSubject", self.roomNewSubject, "plugin")
63 self.bridge.register("tarotGameStarted", self.tarotGameStarted, "plugin") 65 self.bridge.register("tarotGameStarted", self.tarotGameStarted, "plugin")
64 self.bridge.register("tarotGameNew", self.tarotGameNew, "plugin") 66 self.bridge.register("tarotGameNew", self.tarotGameNew, "plugin")
65 self.bridge.register("tarotGameChooseContrat", self.tarotChooseContrat, "plugin") 67 self.bridge.register("tarotGameChooseContrat", self.tarotChooseContrat, "plugin")
66 self.bridge.register("tarotGameShowCards", self.tarotShowCards, "plugin") 68 self.bridge.register("tarotGameShowCards", self.tarotShowCards, "plugin")
288 self.chat_wins[room_jid].setType("group") 290 self.chat_wins[room_jid].setType("group")
289 self.chat_wins[room_jid].id = room_jid 291 self.chat_wins[room_jid].id = room_jid
290 self.chat_wins[room_jid].setPresents(list(set([user_nick]+room_nicks))) 292 self.chat_wins[room_jid].setPresents(list(set([user_nick]+room_nicks)))
291 self.contact_list.setSpecial(JID(room_jid), "MUC") 293 self.contact_list.setSpecial(JID(room_jid), "MUC")
292 294
295 def roomLeft(self, room_jid, profile):
296 """Called when a MUC room is left"""
297 if not self.check_profile(profile):
298 return
299 debug (_("Room [%(room_jid)s] left by %(profile)s") % {'room_jid':room_jid, 'profile': profile})
300 del self.chat_wins[room_jid]
301 self.contact_list.remove(room_jid)
293 302
294 def roomUserJoined(self, room_jid, user_nick, user_data, profile): 303 def roomUserJoined(self, room_jid, user_nick, user_data, profile):
295 """Called when an user joined a MUC room""" 304 """Called when an user joined a MUC room"""
296 if not self.check_profile(profile): 305 if not self.check_profile(profile):
297 return 306 return
304 if not self.check_profile(profile): 313 if not self.check_profile(profile):
305 return 314 return
306 if self.chat_wins.has_key(room_jid): 315 if self.chat_wins.has_key(room_jid):
307 self.chat_wins[room_jid].removeUser(user_nick) 316 self.chat_wins[room_jid].removeUser(user_nick)
308 debug (_("user [%(user_nick)s] left room [%(room_jid)s]") % {'user_nick':user_nick, 'room_jid':room_jid}) 317 debug (_("user [%(user_nick)s] left room [%(room_jid)s]") % {'user_nick':user_nick, 'room_jid':room_jid})
318
319 def roomUserChangedNick(self, room_jid, old_nick, new_nick, profile):
320 """Called when an user joined a MUC room"""
321 if not self.check_profile(profile):
322 return
323 if self.chat_wins.has_key(room_jid):
324 self.chat_wins[room_jid].changeUserNick(old_nick, new_nick)
325 debug (_("user [%(old_nick)s] is now known as [%(new_nick)s] in room [%(room_jid)s]") % {'old_nick':old_nick, 'new_nick':new_nick, 'room_jid':room_jid})
309 326
310 def roomNewSubject(self, room_jid, subject, profile): 327 def roomNewSubject(self, room_jid, subject, profile):
311 """Called when subject of MUC room change""" 328 """Called when subject of MUC room change"""
312 if not self.check_profile(profile): 329 if not self.check_profile(profile):
313 return 330 return