Daniel Brötzmann pushed to branch master at gajim / gajim
Commits:
-
7a3a6822
by wurstsalat at 2022-05-18T19:30:01+02:00
1 changed file:
Changes:
| ... | ... | @@ -1384,7 +1384,11 @@ def remove_history(self, account: str, jid: JID) -> None: |
| 1384 | 1384 | If it's a group chat, remove last MAM ID as well.
|
| 1385 | 1385 | """
|
| 1386 | 1386 | account_id = self.get_account_id(account)
|
| 1387 | - jid_id = self.get_jid_id(jid)
|
|
| 1387 | + try:
|
|
| 1388 | + jid_id = self.get_jid_id(jid)
|
|
| 1389 | + except ValueError:
|
|
| 1390 | + log.info('No history entries for: %s', jid)
|
|
| 1391 | + return
|
|
| 1388 | 1392 | sql = 'DELETE FROM logs WHERE account_id = ? AND jid_id = ?'
|
| 1389 | 1393 | self._con.execute(sql, (account_id, jid_id))
|
| 1390 | 1394 | |
| ... | ... | @@ -1392,7 +1396,11 @@ def remove_history(self, account: str, jid: JID) -> None: |
| 1392 | 1396 | log.info('Removed history for: %s', jid)
|
| 1393 | 1397 | |
| 1394 | 1398 | def forget_jid_data(self, account: str, jid: JID) -> None:
|
| 1395 | - jid_id = self.get_jid_id(jid)
|
|
| 1399 | + try:
|
|
| 1400 | + jid_id = self.get_jid_id(jid)
|
|
| 1401 | + except ValueError:
|
|
| 1402 | + log.info('No history entries for: %s', jid)
|
|
| 1403 | + return
|
|
| 1396 | 1404 | sql = 'DELETE FROM jids WHERE jid_id = ?'
|
| 1397 | 1405 | self._con.execute(sql, (jid_id,))
|
| 1398 | 1406 |