* In order to allow the viewing of the roster when we are offline (and some other cool stuffs), with and without roster versioning, now we load roster when RosterWindow is created (at gajim startup). Fixes #3190

This commit is contained in:
Anaël Verrier 2009-06-30 11:46:27 +02:00
parent 5e4fb8fddb
commit 4d10bdcf6f
4 changed files with 12 additions and 2 deletions

View File

@ -2452,6 +2452,7 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
def _on_roster_set(self, roster):
roster_version = roster.version
received_from_server = roster.received_from_server
raw_roster = roster.getRaw()
roster = {}
our_jid = helpers.parse_jid(gajim.get_jid_from_account(self.name))
@ -2490,9 +2491,10 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
# we can't determine which iconset to use
self.discoverInfo(jid)
self.dispatch('ROSTER', roster)
gajim.logger.replace_roster(self.name, roster_version, roster)
print raw_roster
gajim.logger.replace_roster(self.name, roster_version, roster)
if received_from_server:
self.dispatch('ROSTER', roster)
def _send_first_presence(self, signed = ''):
show = self.continue_connect_info[0]

View File

@ -43,6 +43,7 @@ class NonBlockingRoster(PlugIn):
self._data = {}
self.set=None
self._exported_methods=[self.getRoster]
self.received_from_server = False
def Request(self,force=0):
''' Request roster from server if it were not yet requested
@ -67,6 +68,7 @@ class NonBlockingRoster(PlugIn):
return
query = stanza.getTag('query')
if query:
self.received_from_server = True
self.version = stanza.getTagAttr('query', 'ver')
if self.version is None:
self.version = ''

View File

@ -3423,6 +3423,7 @@ class Interface:
gtk.window_set_default_icon(pix)
self.roster = roster_window.RosterWindow()
self.roster.init_roster()
self.init_emoticons()
self.make_regexps()

View File

@ -6176,6 +6176,11 @@ class RosterWindow:
# #self.xml.get_widget('menubar').hide()
# return
def init_roster(self):
for account in gajim.connections:
roster = gajim.logger.get_roster(gajim.get_jid_from_account(account))
gajim.handlers['ROSTER'](account, roster)
################################################################################
###
################################################################################