Mercurial > libervia-web
comparison libervia.py @ 138:008fa8d36602
browser side: our own microblogs are now requested once logged
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 28 Oct 2012 18:24:18 +0100 |
parents | b145da69a218 |
children | b6658f3ac8a0 |
comparison
equal
deleted
inserted
replaced
137:b145da69a218 | 138:008fa8d36602 |
---|---|
205 #it's time to fill the page | 205 #it's time to fill the page |
206 self.bridge.call('getContacts', self._getContactsCB) | 206 self.bridge.call('getContacts', self._getContactsCB) |
207 self.bridge_signals.call('getSignals', self._getSignalsCB) | 207 self.bridge_signals.call('getSignals', self._getSignalsCB) |
208 #We want to know our own jid | 208 #We want to know our own jid |
209 self.bridge.call('getProfileJid', self._getProfileJidCB) | 209 self.bridge.call('getProfileJid', self._getProfileJidCB) |
210 #we fill the panels already here | |
211 for lib_wid in self.libervia_widgets: | |
212 if isinstance(lib_wid, panels.MicroblogPanel): | |
213 if lib_wid.accept_all(): | |
214 self.bridge.call('getMassiveLastMblogs', lib_wid.massiveInsert, 'ALL', [], 10) | |
215 else: | |
216 self.bridge.call('getMassiveLastMblogs', lib_wid.massiveInsert, 'GROUP', lib_wid.accepted_groups, 10) | |
217 | 210 |
218 | 211 |
219 def _getContactsCB(self, contacts_data): | 212 def _getContactsCB(self, contacts_data): |
220 for contact in contacts_data: | 213 for contact in contacts_data: |
221 jid, attributes, groups = contact | 214 jid, attributes, groups = contact |
274 self.bridge.call('getPresenceStatus', self._getPresenceStatusCb) | 267 self.bridge.call('getPresenceStatus', self._getPresenceStatusCb) |
275 #the rooms where we are | 268 #the rooms where we are |
276 self.bridge.call('getRoomsJoined', self._getRoomsJoinedCb) | 269 self.bridge.call('getRoomsJoined', self._getRoomsJoinedCb) |
277 #and if there is any subscription request waiting for us | 270 #and if there is any subscription request waiting for us |
278 self.bridge.call('getWaitingSub', self._getWaitingSubCb) | 271 self.bridge.call('getWaitingSub', self._getWaitingSubCb) |
272 #we fill the panels already here | |
273 for lib_wid in self.libervia_widgets: | |
274 if isinstance(lib_wid, panels.MicroblogPanel): | |
275 if lib_wid.accept_all(): | |
276 self.bridge.call('getMassiveLastMblogs', lib_wid.massiveInsert, 'ALL', [], 10) | |
277 else: | |
278 self.bridge.call('getMassiveLastMblogs', lib_wid.massiveInsert, 'GROUP', lib_wid.accepted_groups, 10) | |
279 #FIXME: we currently get all post and filter after for each widget, need to be optimised | |
280 self.bridge.call('getMassiveLastMblogs', lib_wid.massiveInsert, 'JID', [jid], 10) | |
279 | 281 |
280 ## Signals callbacks ## | 282 ## Signals callbacks ## |
281 | 283 |
282 def _personalEventCb(self, sender, event_type, data): | 284 def _personalEventCb(self, sender, event_type, data): |
283 if event_type == "MICROBLOG": | 285 if event_type == "MICROBLOG": |