Mercurial > libervia-web
comparison 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 |
comparison
equal
deleted
inserted
replaced
49:f1d2eb9b2523 | 50:72c51a4839cc |
---|---|
185 if JID(from_jid).userhost() != sat_jid.userhost() and JID(to_jid).userhost() != sat_jid.userhost(): | 185 if JID(from_jid).userhost() != sat_jid.userhost() and JID(to_jid).userhost() != sat_jid.userhost(): |
186 error("Trying to get history from a different jid, maybe a hack attempt ?") | 186 error("Trying to get history from a different jid, maybe a hack attempt ?") |
187 return {} | 187 return {} |
188 return self.sat_host.bridge.getHistory(from_jid, to_jid, size) | 188 return self.sat_host.bridge.getHistory(from_jid, to_jid, size) |
189 | 189 |
190 def jsonrpc_joinMUC(self, room_jid, nick): | |
191 """Join a Multi-User Chat room""" | |
192 profile = ISATSession(self.session).profile | |
193 try: | |
194 room_jid = JID(room_jid) | |
195 except: | |
196 warning('Invalid room jid') | |
197 return | |
198 self.sat_host.bridge.joinMUC(room_jid.host, room_jid.user, nick, profile) | |
199 | |
190 def jsonrpc_getRoomJoined(self): | 200 def jsonrpc_getRoomJoined(self): |
191 """Return list of room already joined by user""" | 201 """Return list of room already joined by user""" |
192 profile = ISATSession(self.session).profile | 202 profile = ISATSession(self.session).profile |
193 return self.sat_host.bridge.getRoomJoined(profile) | 203 return self.sat_host.bridge.getRoomJoined(profile) |
194 | 204 |
358 | 368 |
359 Here are your connection informations: | 369 Here are your connection informations: |
360 login: %(login)s | 370 login: %(login)s |
361 password: %(password)s | 371 password: %(password)s |
362 | 372 |
373 Your Jabber ID (JID) is: %(jid)s | |
374 | |
363 Any feedback welcome | 375 Any feedback welcome |
364 | 376 |
365 Cheers | 377 Cheers |
366 Goffi""" % { 'login': login, 'password': password }).encode('utf-8') | 378 Goffi""" % { 'login': login, 'password': password, 'jid':"%s@%s" % (login, _NEW_ACCOUNT_DOMAIN) }).encode('utf-8') |
367 msg = MIMEText(body, 'plain', 'UTF-8') | 379 msg = MIMEText(body, 'plain', 'UTF-8') |
368 msg['Subject'] = 'Libervia account created' | 380 msg['Subject'] = 'Libervia account created' |
369 msg['From'] = _email_from | 381 msg['From'] = _email_from |
370 msg['To'] = email | 382 msg['To'] = email |
371 | 383 |
380 msg['From'] = _email_from | 392 msg['From'] = _email_from |
381 msg['To'] = _REG_ADMIN_EMAIL | 393 msg['To'] = _REG_ADMIN_EMAIL |
382 | 394 |
383 d = sendmail(_email_host, _email_from, email, msg.as_string()) | 395 d = sendmail(_email_host, _email_from, email, msg.as_string()) |
384 d.addCallbacks(email_ok, email_ko) | 396 d.addCallbacks(email_ok, email_ko) |
385 print "rturn REGISTRATION" | |
386 return "REGISTRATION" | 397 return "REGISTRATION" |
387 | 398 |
388 def __cleanWaiting(self, login): | 399 def __cleanWaiting(self, login): |
389 """Remove login from waiting queue""" | 400 """Remove login from waiting queue""" |
390 try: | 401 try: |