Daniel Brötzmann pushed to branch master at gajim / gajim
Commits:
9df3a354 by wurstsalat at 2022-01-26T21:32:30+01:00
Archive: Remove workaround
- - - - -
2 changed files:
- gajim/common/storage/archive.py
- gajim/gtk/controls/base.py
Changes:
=====================================
gajim/common/storage/archive.py
=====================================
@@ -413,53 +413,6 @@ def get_conversation_before_after(self,
sql,
tuple(jids) + (timestamp, n_lines)).fetchall()
- @timeit
- def get_conversation_muc_before_after(self,
- _account: str,
- jid: JID,
- before: bool,
- timestamp: float,
- n_lines: int
- ) -> list[ConversationRow]:
- """
- Load n_lines lines of conversation with jid before or after timestamp
-
- :param account: The account
-
- :param jid: The jid for which we request the conversation
-
- :param before: bool for direction (before or after timestamp)
-
- :param timestamp: timestamp
-
- returns a list of namedtuples
- """
- jids = [jid]
- if before:
- time_order = 'AND time < ? ORDER BY time DESC, log_line_id DESC'
- else:
- time_order = 'AND time > ? ORDER BY time ASC, log_line_id ASC'
-
- # TODO: this does not load messages correctly when account_id is set
- # account_id = self.get_account_id(account,
type_=JIDConstant.ROOM_TYPE)
-
- sql = '''
- SELECT contact_name, time, kind, show, message, subject,
- additional_data, log_line_id, message_id, stanza_id,
- error as "error [common_error]",
- marker as "marker [marker]"
- FROM logs NATURAL JOIN jids WHERE jid IN ({jids})
- AND kind = {kind}
- {time_order}
- LIMIT ?
- '''.format(jids=', '.join('?' * len(jids)),
- kind=KindConstant.GC_MSG,
- time_order=time_order)
-
- return self._con.execute(
- sql,
- tuple(jids) + (timestamp, n_lines)).fetchall()
-
@timeit
def get_last_conversation_line(self,
account: str,
=====================================
gajim/gtk/controls/base.py
=====================================
@@ -1436,20 +1436,12 @@ def fetch_n_lines_history(self,
else:
timestamp = row.db_timestamp
- if self.is_groupchat:
- messages = app.storage.archive.get_conversation_muc_before_after(
- self.account,
- self.contact.jid,
- before,
- timestamp,
- n_lines)
- else:
- messages = app.storage.archive.get_conversation_before_after(
- self.account,
- self.contact.jid,
- before,
- timestamp,
- n_lines)
+ messages = app.storage.archive.get_conversation_before_after(
+ self.account,
+ self.contact.jid,
+ before,
+ timestamp,
+ n_lines)
self._chat_loaded = True
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/9df3a3545afbe4554110524f063deb0a005c2050
--
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/9df3a3545afbe4554110524f063deb0a005c2050
You're receiving this email because of your account on dev.gajim.org.
_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits