comparison 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
comparison
equal deleted inserted replaced
10:c28a4840e1a8 11:331c093e4eb3
53 parsed = jsonrpclib.loads(request.content.read()) 53 parsed = jsonrpclib.loads(request.content.read())
54 fault = jsonrpclib.Fault(0, "Not allowed") #FIXME: define some standard error codes for libervia 54 fault = jsonrpclib.Fault(0, "Not allowed") #FIXME: define some standard error codes for libervia
55 return jsonrpc.JSONRPC._cbRender(self, fault, request, parsed.get('id'), parsed.get('jsonrpc')) 55 return jsonrpc.JSONRPC._cbRender(self, fault, request, parsed.get('id'), parsed.get('jsonrpc'))
56 return jsonrpc.JSONRPC.render(self, request) 56 return jsonrpc.JSONRPC.render(self, request)
57 57
58
59 def jsonrpc_getContacts(self): 58 def jsonrpc_getContacts(self):
60 """Return all passed args.""" 59 """Return all passed args."""
61 profile = self.session.sat_profile 60 profile = self.session.sat_profile
62 return self.sat_host.bridge.getContacts(profile) 61 return self.sat_host.bridge.getContacts(profile)
62
63 def jsonrpc_sendMblog(self, raw_text):
64 """Parse raw_text of the microblog box, and send message consequently"""
65 profile = self.session.sat_profile
66 if raw_text.startswith('@@: '):
67 #This text if for the public microblog
68 text = raw_text[4:]
69 if text:
70 return self.sat_host.bridge.sendPersonalEvent("MICROBLOG", {'content':text}, profile)
63 71
64 class Register(jsonrpc.JSONRPC): 72 class Register(jsonrpc.JSONRPC):
65 """This class manage the registration procedure with SàT 73 """This class manage the registration procedure with SàT
66 It provide an api for the browser, check password and setup the web server""" 74 It provide an api for the browser, check password and setup the web server"""
67 75