comparison libervia.py @ 215:e830a0c60d32

server side: added the security_limit to setParam - in addition to the check which is done by the core, libervia checks if the param to be modified was really part of the XML that has been returned by getParams with security_limit = 0.
author souliane <souliane@mailoo.org>
date Sat, 07 Sep 2013 02:07:07 +0200
parents 8bbac49765d6
children 4e6467efd6bf
comparison
equal deleted inserted replaced
214:7b26be266ab1 215:e830a0c60d32
97 ["isRegistered","isConnected","connect"]) 97 ["isRegistered","isConnected","connect"])
98 98
99 class BridgeCall(LiberviaJsonProxy): 99 class BridgeCall(LiberviaJsonProxy):
100 def __init__(self): 100 def __init__(self):
101 LiberviaJsonProxy.__init__(self, "/json_api", 101 LiberviaJsonProxy.__init__(self, "/json_api",
102 ["getContacts", "addContact", "sendMessage", "sendMblog", "sendMblogComment", "getLastMblogs", "getMassiveLastMblogs", "getMblogComments", "getProfileJid", "getHistory", "getPresenceStatus", 102 ["getContacts", "addContact", "sendMessage", "sendMblog", "sendMblogComment",
103 "joinMUC", "mucLeave", "getRoomsJoined", "launchTarotGame", "getTarotCardsPaths", "tarotGameReady", "tarotGameContratChoosed", "tarotGamePlayCards", 103 "getLastMblogs", "getMassiveLastMblogs", "getMblogComments", "getProfileJid",
104 "launchRadioCollective", "getWaitingSub", "subscription", "delContact", "updateContact", "getCard", "getEntityData", "getParamsUI", "chatStateComposing", 104 "getHistory", "getPresenceStatus", "joinMUC", "mucLeave", "getRoomsJoined",
105 #"setParam", 105 "launchTarotGame", "getTarotCardsPaths", "tarotGameReady",
106 "launchAction", "disconnect", 106 "tarotGameContratChoosed", "tarotGamePlayCards", "launchRadioCollective",
107 "getWaitingSub", "subscription", "delContact", "updateContact", "getCard",
108 "getEntityData", "getParamsUI", "setParam", "launchAction", "disconnect",
109 "chatStateComposing"
107 ]) 110 ])
108 111
109 class BridgeSignals(LiberviaJsonProxy): 112 class BridgeSignals(LiberviaJsonProxy):
110 RETRY_BASE_DELAY = 1000 113 RETRY_BASE_DELAY = 1000
111 114
353 _groups = set(mblog['groups'].split() if mblog['groups'] else []) 356 _groups = set(mblog['groups'].split() if mblog['groups'] else [])
354 else: 357 else:
355 _groups=None 358 _groups=None
356 mblog_entry = MicroblogItem(mblog) 359 mblog_entry = MicroblogItem(mblog)
357 self.mblog_cache.append((_groups, mblog_entry)) 360 self.mblog_cache.append((_groups, mblog_entry))
358 361
359 if len(self.mblog_cache) > MAX_MBLOG_CACHE: 362 if len(self.mblog_cache) > MAX_MBLOG_CACHE:
360 del self.mblog_cache[0:len(self.mblog_cache-MAX_MBLOG_CACHE)] 363 del self.mblog_cache[0:len(self.mblog_cache-MAX_MBLOG_CACHE)]
361 for lib_wid in self.libervia_widgets: 364 for lib_wid in self.libervia_widgets:
362 if isinstance(lib_wid, panels.MicroblogPanel): 365 if isinstance(lib_wid, panels.MicroblogPanel):
363 self.FillMicroblogPanel(lib_wid) 366 self.FillMicroblogPanel(lib_wid)