comparison frontends/quick_frontend/quick_app.py @ 76:8becde8a967c

MUC: added subject management - plugin xep-0045: added roomNewSubject signal - wix: added subject bar for group windows
author Goffi <goffi@goffi.org>
date Tue, 30 Mar 2010 13:15:05 +1100
parents 7322a41f8a8e
children ace2af8abc5a
comparison
equal deleted inserted replaced
75:7322a41f8a8e 76:8becde8a967c
43 self.bridge.register("newMessage", self.newMessage) 43 self.bridge.register("newMessage", self.newMessage)
44 self.bridge.register("presenceUpdate", self.presenceUpdate) 44 self.bridge.register("presenceUpdate", self.presenceUpdate)
45 self.bridge.register("roomJoined", self.roomJoined) 45 self.bridge.register("roomJoined", self.roomJoined)
46 self.bridge.register("roomUserJoined", self.roomUserJoined) 46 self.bridge.register("roomUserJoined", self.roomUserJoined)
47 self.bridge.register("roomUserLeft", self.roomUserLeft) 47 self.bridge.register("roomUserLeft", self.roomUserLeft)
48 self.bridge.register("roomNewSubject", self.roomNewSubject)
48 self.bridge.register("subscribe", self.subscribe) 49 self.bridge.register("subscribe", self.subscribe)
49 self.bridge.register("paramUpdate", self.paramUpdate) 50 self.bridge.register("paramUpdate", self.paramUpdate)
50 self.bridge.register("contactDeleted", self.contactDeleted) 51 self.bridge.register("contactDeleted", self.contactDeleted)
51 self.bridge.register("updatedValue", self.updatedValue, "request") 52 self.bridge.register("updatedValue", self.updatedValue, "request")
52 self.bridge.register("askConfirmation", self.askConfirmation, "request") 53 self.bridge.register("askConfirmation", self.askConfirmation, "request")
213 if not self.__check_profile(profile): 214 if not self.__check_profile(profile):
214 return 215 return
215 room_jid=room_id+'@'+room_service 216 room_jid=room_id+'@'+room_service
216 if self.chat_wins.has_key(room_jid): 217 if self.chat_wins.has_key(room_jid):
217 self.chat_wins[room_jid].replaceUser(user_nick) 218 self.chat_wins[room_jid].replaceUser(user_nick)
218 debug (_("user [%(user_nick)s] joined room [%(room_jid)s]") % {'user_nick':user_nick, 'room_jid':room_jid}) 219 debug (_("user [%(user_nick)s] joined room [%(room_jid)s]") % {'user_nick':user_nick, 'room_jid':room_jid})
219 220
220 def roomUserLeft(self, room_id, room_service, user_nick, user_data, profile): 221 def roomUserLeft(self, room_id, room_service, user_nick, user_data, profile):
221 """Called when an user joined a MUC room""" 222 """Called when an user joined a MUC room"""
222 if not self.__check_profile(profile): 223 if not self.__check_profile(profile):
223 return 224 return
224 room_jid=room_id+'@'+room_service 225 room_jid=room_id+'@'+room_service
225 if self.chat_wins.has_key(room_jid): 226 if self.chat_wins.has_key(room_jid):
226 self.chat_wins[room_jid].removeUser(user_nick) 227 self.chat_wins[room_jid].removeUser(user_nick)
227 debug (_("user [%(user_nick)s] left room [%(room_jid)s]") % {'user_nick':user_nick, 'room_jid':room_jid}) 228 debug (_("user [%(user_nick)s] left room [%(room_jid)s]") % {'user_nick':user_nick, 'room_jid':room_jid})
229
230 def roomNewSubject(self, room_id, room_service, subject, profile):
231 """Called when subject of MUC room change"""
232 if not self.__check_profile(profile):
233 return
234 room_jid=room_id+'@'+room_service
235 if self.chat_wins.has_key(room_jid):
236 self.chat_wins[room_jid].setSubject(subject)
237 debug (_("new subject for room [%(room_jid)s]: %(subject)s") % {'room_jid':room_jid, "subject":subject})
238
228 239
229 def subscribe(self, type, raw_jid, profile): 240 def subscribe(self, type, raw_jid, profile):
230 """Called when a subsciption maangement signal is received""" 241 """Called when a subsciption maangement signal is received"""
231 if not self.__check_profile(profile): 242 if not self.__check_profile(profile):
232 return 243 return