# HG changeset patch # User Goffi # Date 1340579030 -7200 # Node ID ceef355156de1fc44e8f2a53aaff4046ce82a677 # Parent ee7b4aecdc6709711499f323b666a00176ee3ffc server + browser side: groupblog subscription + fixed blog insertion order diff -r ee7b4aecdc67 -r ceef355156de browser_side/panels.py --- a/browser_side/panels.py Thu Apr 05 09:28:48 2012 +0200 +++ b/browser_side/panels.py Mon Jun 25 01:03:50 2012 +0200 @@ -99,7 +99,8 @@ if item_type=="GROUP": _new_panel = MicroblogPanel(self.host, [item]) _new_panel.setAcceptedGroup(item) - self.host.FillMicroblogPanel(_new_panel) #XXX: cache is temporarly deactivated, need to be reworked + #self.host.FillMicroblogPanel(_new_panel) #XXX: cache is temporarly deactivated, need to be reworked + self.host.bridge.call('getMassiveLastMblogs', _new_panel.massiveInsert, 'GROUP', [item], 10) elif item_type=="CONTACT": _contact = JID(item) self.host.contact_panel.setContactMessageWaiting(_contact.bare, False) @@ -489,6 +490,7 @@ SimplePanel.__init__(self) self.author = mblog_entry.author + self.timestamp = mblog_entry.timestamp _datetime = datetime.fromtimestamp(mblog_entry.timestamp) self.panel = HTMLPanel(""" @@ -556,7 +558,18 @@ return _entry = MicroblogEntry(self.host, mblog_entry) self.entries[mblog_entry.id] = _entry - self.vpanel.insert(_entry,0) + + # we look for the right index to insert our entry: + # we insert the entry above the first entry + # in the past + idx = 0 + for child in self.vpanel.children: + if not isinstance(child, MicroblogEntry): + break + if child.timestamp < mblog_entry.timestamp: + break + idx+=1 + self.vpanel.insert(_entry,idx) def updateValue(self, type, jid, value): """Update a jid value in entries diff -r ee7b4aecdc67 -r ceef355156de libervia.py --- a/libervia.py Thu Apr 05 09:28:48 2012 +0200 +++ b/libervia.py Mon Jun 25 01:03:50 2012 +0200 @@ -207,7 +207,7 @@ self.bridge_signals.call('getSignals', self._getSignalsCB) #We want to know our own jid self.bridge.call('getProfileJid', self._getProfileJidCB) - #we fill the panels already herei + #we fill the panels already here for lib_wid in self.libervia_widgets: if isinstance(lib_wid, panels.MicroblogPanel): if lib_wid.accept_all(): diff -r ee7b4aecdc67 -r ceef355156de libervia.tac --- a/libervia.tac Thu Apr 05 09:28:48 2012 +0200 +++ b/libervia.tac Mon Jun 25 01:03:50 2012 +0200 @@ -226,6 +226,7 @@ profile = ISATSession(self.session).profile d = defer.Deferred() self.sat_host.bridge.getMassiveLastGroupBlogs(publishers_type, publishers_list, max_item, profile, callback=d.callback, errback=d.errback) + self.sat_host.bridge.massiveSubscribeGroupBlogs(publishers_type, publishers_list, profile) return d def jsonrpc_getPresenceStatus(self):