diff frontends/src/quick_frontend/quick_app.py @ 405:10b4f577d0c0

MUC update to follow wokkel's MUC branch update - bridge methods have been updated (API change) - plugin XEP-0045 has been updated
author Goffi <goffi@goffi.org>
date Sat, 08 Oct 2011 18:43:17 +0200
parents f964dcec1611
children f6f94e21c642
line wrap: on
line diff
--- a/frontends/src/quick_frontend/quick_app.py	Sat Oct 08 11:19:25 2011 +0200
+++ b/frontends/src/quick_frontend/quick_app.py	Sat Oct 08 18:43:17 2011 +0200
@@ -160,10 +160,10 @@
                 self.subscribe(waitingSub[sub], sub, profile)
 
             #Now we open the MUC window where we already are:
-            for room_args in self.bridge.getRoomJoined(profile):
+            for room_args in self.bridge.getRoomsJoined(profile):
                 self.roomJoined(*room_args, profile=profile)
 
-            for subject_args in self.bridge.getRoomSubjects(profile):
+            for subject_args in self.bridge.getRoomsSubjectss(profile):
                 self.roomNewSubject(*subject_args, profile=profile)
         
         if autoconnect and not self.bridge.isConnected(profile_key):
@@ -283,41 +283,37 @@
             if not self.CM.isConnected(from_jid):
                 self.contactList.disconnect(from_jid)
     
-    def roomJoined(self, room_id, room_service, room_nicks, user_nick, profile):
+    def roomJoined(self, room_jid, room_nicks, user_nick, profile):
         """Called when a MUC room is joined"""
         if not self.check_profile(profile):
             return
-        debug (_("Room [%(room_name)s] joined by %(profile)s, users presents:%(users)s") % {'room_name':room_id+'@'+room_service, 'profile': profile, 'users':room_nicks})
-        room_jid=room_id+'@'+room_service
+        debug (_("Room [%(room_jid)s] joined by %(profile)s, users presents:%(users)s") % {'room_jid':room_jid, 'profile': profile, 'users':room_nicks})
         self.chat_wins[room_jid].setUserNick(user_nick)
         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)))
 
 
-    def roomUserJoined(self, room_id, room_service, user_nick, user_data, profile):
+    def roomUserJoined(self, room_jid, user_nick, user_data, profile):
         """Called when an user joined a MUC room"""
         if not self.check_profile(profile):
             return
-        room_jid=room_id+'@'+room_service
         if self.chat_wins.has_key(room_jid):
             self.chat_wins[room_jid].replaceUser(user_nick)
             debug (_("user [%(user_nick)s] joined room [%(room_jid)s]") % {'user_nick':user_nick, 'room_jid':room_jid})
 
-    def roomUserLeft(self, room_id, room_service, user_nick, user_data, profile):
+    def roomUserLeft(self, room_jid, user_nick, user_data, profile):
         """Called when an user joined a MUC room"""
         if not self.check_profile(profile):
             return
-        room_jid=room_id+'@'+room_service
         if self.chat_wins.has_key(room_jid):
             self.chat_wins[room_jid].removeUser(user_nick)
             debug (_("user [%(user_nick)s] left room [%(room_jid)s]") % {'user_nick':user_nick, 'room_jid':room_jid})
 
-    def roomNewSubject(self, room_id, room_service, subject, profile):
+    def roomNewSubject(self, room_jid, subject, profile):
         """Called when subject of MUC room change"""
         if not self.check_profile(profile):
             return
-        room_jid=room_id+'@'+room_service
         if self.chat_wins.has_key(room_jid):
             self.chat_wins[room_jid].setSubject(subject)
             debug (_("new subject for room [%(room_jid)s]: %(subject)s") % {'room_jid':room_jid, "subject":subject})