Mercurial > libervia-web
diff libervia.tac @ 11:331c093e4eb3
magicBox is now able to send global microblog
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 26 Mar 2011 17:53:12 +0100 |
parents | c28a4840e1a8 |
children | 9bf8ed012adc |
line wrap: on
line diff
--- a/libervia.tac Fri Mar 25 00:32:58 2011 +0100 +++ b/libervia.tac Sat Mar 26 17:53:12 2011 +0100 @@ -55,12 +55,20 @@ return jsonrpc.JSONRPC._cbRender(self, fault, request, parsed.get('id'), parsed.get('jsonrpc')) return jsonrpc.JSONRPC.render(self, request) - def jsonrpc_getContacts(self): """Return all passed args.""" profile = self.session.sat_profile return self.sat_host.bridge.getContacts(profile) + def jsonrpc_sendMblog(self, raw_text): + """Parse raw_text of the microblog box, and send message consequently""" + profile = self.session.sat_profile + if raw_text.startswith('@@: '): + #This text if for the public microblog + text = raw_text[4:] + if text: + return self.sat_host.bridge.sendPersonalEvent("MICROBLOG", {'content':text}, profile) + class Register(jsonrpc.JSONRPC): """This class manage the registration procedure with SàT It provide an api for the browser, check password and setup the web server"""