diff --git a/src/common/connection_handlers.py b/src/common/connection_handlers.py index d8f9314b6..856653eb2 100644 --- a/src/common/connection_handlers.py +++ b/src/common/connection_handlers.py @@ -1243,12 +1243,12 @@ class ConnectionVcard: pass elif self.awaiting_answers[id_][0] == ARCHIVING_COLLECTION_ARRIVED: - def save_if_not_exists(with_, direction, tim, payload): + def save_if_not_exists(with_, nick, direction, tim, payload): assert len(payload) == 1, 'got several archiving messages in the' +\ ' same time %s' % ''.join(payload) if payload[0].getName() == 'body': gajim.logger.save_if_not_exists(with_, direction, tim, - msg=payload[0].getData()) + msg=payload[0].getData(), nick=nick) elif payload[0].getName() == 'message': print 'Not implemented' chat = iq_obj.getTag('chat') @@ -1265,12 +1265,13 @@ class ConnectionVcard: secs = 0 if secs: tim += secs + nick = element.getAttr('name') if element.getName() == 'from': - save_if_not_exists(with_, 'from', localtime(tim), + save_if_not_exists(with_, nick, 'from', localtime(tim), element.getPayload()) nb += 1 if element.getName() == 'to': - save_if_not_exists(with_, 'to', localtime(tim), + save_if_not_exists(with_, nick, 'to', localtime(tim), element.getPayload()) nb += 1 set_ = chat.getTag('set') diff --git a/src/common/logger.py b/src/common/logger.py index 34634be6e..0ab6647c2 100644 --- a/src/common/logger.py +++ b/src/common/logger.py @@ -981,16 +981,21 @@ class Logger: (account_jid_id,)) self.con.commit() - def save_if_not_exists(self, with_, direction, tim, msg=''): + def save_if_not_exists(self, with_, direction, tim, msg='', nick=None): if tim: time_col = int(float(time.mktime(tim))) else: time_col = int(float(time.time())) if msg: - if self.jid_is_from_pm(with_): - # We cannot know if it's a pm or groupchat message because we only - # get body of the message - type_ = 'gc_msg' + if self.jid_is_room_jid(with_) or nick: + # It's a groupchat message + if nick: + # It's a message from a groupchat occupent + type_ = 'gc_msg' + with_ = with_ + '/' + nick + else: + # It's a server message message, we don't log them + return else: if direction == 'from': type_ = 'chat_msg_recv' diff --git a/src/common/message_archiving.py b/src/common/message_archiving.py index bcb28fcc1..a029d7086 100644 --- a/src/common/message_archiving.py +++ b/src/common/message_archiving.py @@ -179,12 +179,12 @@ class ConnectionArchive: self.dispatch('ARCHIVING_CHANGED', ('itemremove', item.getAttr('jid'))) - def request_collections_list_page(self, with='', start=None, end=None, + def request_collections_list_page(self, with_='', start=None, end=None, after=None, max=30, exact_match=False): iq_ = common.xmpp.Iq('get') list_ = iq_.setTag('list', namespace=common.xmpp.NS_ARCHIVE) - if with: - list_.setAttr('with', with) + if with_: + list_.setAttr('with', with_) if exact_match: list_.setAttr('exactmatch', 'true') if start: @@ -200,11 +200,11 @@ class ConnectionArchive: self.awaiting_answers[id_] = (ARCHIVING_COLLECTIONS_ARRIVED, ) self.connection.send(iq_) - def request_collection_page(self, with, start, end=None, after=None, + def request_collection_page(self, with_, start, end=None, after=None, max=30, exact_match=False): iq_ = common.xmpp.Iq('get') retrieve = iq_.setTag('retrieve', namespace=common.xmpp.NS_ARCHIVE, - attrs={'with': with, 'start': start}) + attrs={'with': with_, 'start': start}) if exact_match: retrieve.setAttr('exactmatch', 'true') set_ = retrieve.setTag('set', namespace=common.xmpp.NS_RSM) @@ -216,12 +216,12 @@ class ConnectionArchive: self.awaiting_answers[id_] = (ARCHIVING_COLLECTION_ARRIVED, ) self.connection.send(iq_) - def remove_collection(self, with='', start=None, end=None, + def remove_collection(self, with_='', start=None, end=None, exact_match=False, open=False): iq_ = common.xmpp.Iq('set') remove = iq_.setTag('remove', namespace=common.xmpp.NS_ARCHIVE) - if with: - remove.setAttr('with', with) + if with_: + remove.setAttr('with', with_) if exact_match: remove.setAttr('exactmatch', 'true') if start: diff --git a/src/gui_interface.py b/src/gui_interface.py index df0cedef6..bff913616 100644 --- a/src/gui_interface.py +++ b/src/gui_interface.py @@ -3405,7 +3405,6 @@ class Interface: self.last_ftwindow_update = 0 self.music_track_changed_signal = None - self.create_ipython_window() class PassphraseRequest: