diff libervia.tac @ 50:72c51a4839cc

MUC group joining
author Goffi <goffi@goffi.org>
date Thu, 26 May 2011 20:13:41 +0200
parents c3ee630914ba
children f25c4077f6b9
line wrap: on
line diff
--- a/libervia.tac	Thu May 26 19:15:44 2011 +0200
+++ b/libervia.tac	Thu May 26 20:13:41 2011 +0200
@@ -187,6 +187,16 @@
             return {}
         return self.sat_host.bridge.getHistory(from_jid, to_jid, size)
 
+    def jsonrpc_joinMUC(self, room_jid, nick):
+        """Join a Multi-User Chat room"""
+        profile = ISATSession(self.session).profile
+        try:
+            room_jid = JID(room_jid)
+        except:
+            warning('Invalid room jid')
+            return
+        self.sat_host.bridge.joinMUC(room_jid.host, room_jid.user, nick, profile)
+
     def jsonrpc_getRoomJoined(self):
         """Return list of room already joined by user"""
         profile = ISATSession(self.session).profile
@@ -360,10 +370,12 @@
 login: %(login)s
 password: %(password)s
 
+Your Jabber ID (JID) is: %(jid)s
+
 Any feedback welcome
 
 Cheers
-Goffi""" % { 'login': login, 'password': password }).encode('utf-8')
+Goffi""" % { 'login': login, 'password': password, 'jid':"%s@%s" % (login, _NEW_ACCOUNT_DOMAIN) }).encode('utf-8')
         msg = MIMEText(body, 'plain', 'UTF-8')
         msg['Subject'] = 'Libervia account created'
         msg['From'] = _email_from
@@ -382,7 +394,6 @@
 
         d = sendmail(_email_host, _email_from, email, msg.as_string())
         d.addCallbacks(email_ok, email_ko)
-        print "rturn REGISTRATION"
         return "REGISTRATION"
 
     def __cleanWaiting(self, login):