comparison src/server/server.py @ 653:e1d067378ad3 frontends_multi_profiles

browser_side: fixes sending/updating blog message/comment
author souliane <souliane@mailoo.org>
date Fri, 27 Feb 2015 01:45:34 +0100
parents 2df91d0308ac
children a8fddccf5b84
comparison
equal deleted inserted replaced
652:0262fee86375 653:e1d067378ad3
241 profile = ISATSession(self.session).profile 241 profile = ISATSession(self.session).profile
242 return self.asyncBridgeCall("sendMessage", to_jid, msg, subject, type_, options, profile) 242 return self.asyncBridgeCall("sendMessage", to_jid, msg, subject, type_, options, profile)
243 243
244 def jsonrpc_sendMblog(self, type_, dest, text, extra={}): 244 def jsonrpc_sendMblog(self, type_, dest, text, extra={}):
245 """ Send microblog message 245 """ Send microblog message
246 @param type_: one of "PUBLIC", "GROUP" 246 @param type_ (unicode): one of "PUBLIC", "GROUP"
247 @param dest: destinees (list of groups, ignored for "PUBLIC") 247 @param dest (tuple(unicode)): recipient groups (ignored for "PUBLIC")
248 @param text: microblog's text 248 @param text (unicode): microblog's text
249 """ 249 """
250 profile = ISATSession(self.session).profile 250 profile = ISATSession(self.session).profile
251 extra['allow_comments'] = 'True' 251 extra['allow_comments'] = 'True'
252 252
253 if not type_: # auto-detect 253 if not type_: # auto-detect
255 255
256 if type_ in ("PUBLIC", "GROUP") and text: 256 if type_ in ("PUBLIC", "GROUP") and text:
257 if type_ == "PUBLIC": 257 if type_ == "PUBLIC":
258 #This text if for the public microblog 258 #This text if for the public microblog
259 log.debug("sending public blog") 259 log.debug("sending public blog")
260 return self.sat_host.bridge.sendGroupBlog("PUBLIC", [], text, extra, profile) 260 return self.sat_host.bridge.sendGroupBlog("PUBLIC", (), text, extra, profile)
261 else: 261 else:
262 log.debug("sending group blog") 262 log.debug("sending group blog")
263 dest = dest if isinstance(dest, list) else [dest] 263 dest = dest if isinstance(dest, list) else [dest]
264 return self.sat_host.bridge.sendGroupBlog("GROUP", dest, text, extra, profile) 264 return self.sat_host.bridge.sendGroupBlog("GROUP", dest, text, extra, profile)
265 else: 265 else: