Daniel Brötzmann pushed to branch master at gajim / gajim


Commits:
6ca265f1 by wurstsalat at 2022-10-09T16:27:45+02:00
fix: SearchView: Limit displayed results to account_id of contact

- - - - -


1 changed file:

- gajim/common/storage/archive.py


Changes:

=====================================
gajim/common/storage/archive.py
=====================================
@@ -527,7 +527,7 @@ def get_conversation_between(self,
 
     @timeit
     def search_log(self,
-                   _account: str,
+                   account: str,
                    jid: JID,
                    query: str,
                    from_users: Optional[list[str]] = None,
@@ -555,6 +555,7 @@ def search_log(self,
 
         returns a list of namedtuples
         '''
+        account_id = self.get_account_id(account)
         jids = [jid]
 
         kinds = map(str, [KindConstant.STATUS,
@@ -579,12 +580,14 @@ def search_log(self,
             SELECT account_id, jid_id, contact_name, time, kind, show, message,
                    subject, additional_data, log_line_id
             FROM logs NATURAL JOIN jids WHERE jid IN ({jids})
+            AND account_id = {account_id}
             AND message LIKE like(?)
             AND kind NOT IN ({kinds})
             {users_query}
             AND time BETWEEN ? AND ?
             ORDER BY time DESC, log_line_id
             '''.format(jids=', '.join('?' * len(jids)),
+                       account_id=account_id,
                        kinds=', '.join(kinds),
                        users_query=users_query_string)
 



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/6ca265f1af0760deb67ed16170335b7ce54cc00d

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/6ca265f1af0760deb67ed16170335b7ce54cc00d
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

Reply via email to