primitivus, wix: auto-display MUC dialog after it has been joined:

- a patch will follow to add a parameter for the user to choose between "always open", "never open" and "ask each time".
This commit is contained in:
souliane 2013-10-28 18:29:34 +01:00
commit cac3cd810f
5 changed files with 53 additions and 24 deletions

View file

@ -336,7 +336,7 @@ class QuickApp(object):
self.chat_wins[room_jid].setType("group")
self.chat_wins[room_jid].id = room_jid
self.chat_wins[room_jid].setPresents(list(set([user_nick]+room_nicks)))
self.contact_list.setSpecial(JID(room_jid), "MUC")
self.contact_list.setSpecial(JID(room_jid), "MUC", show=True)
def roomLeft(self, room_jid_s, profile):
"""Called when a MUC room is left"""
@ -573,3 +573,4 @@ class QuickApp(object):
self.bridge.disconnect(self.profile)
except:
pass

View file

@ -141,7 +141,6 @@ class QuickChat(object):
"""
raise NotImplementedError
def startGame(self, game_type, referee, players):
"""Configure the chat window to start a game"""
#No need to raise an error as game are not mandatory
@ -151,3 +150,4 @@ class QuickChat(object):
"""Return class managing the game type"""
#No need to raise an error as game are not mandatory
warning(_('getGame is not implemented in this frontend'))

View file

@ -72,10 +72,11 @@ class QuickContactList(object):
"""Return special type of jid, or None if it's not special"""
return self.specials.get(jid.short)
def setSpecial(self, jid, _type):
def setSpecial(self, jid, _type, show=False):
"""Set entity as a special
@param jid: jid of the entity
@param _type: special type (e.g.: "MUC")
@param show: True to display the dialog to chat with this entity
"""
self.specials[jid.short] = _type
@ -89,4 +90,3 @@ class QuickContactList(object):
self.setCache(jid, 'prority', priority)
self.setCache(jid, 'statuses', statuses)
self.update_jid(jid)