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


Commits:
4a98afa4 by wurstsalat at 2023-07-23T21:30:42+02:00
Fix return type of get_days_containing_messages

- - - - -


2 changed files:

- gajim/common/storage/archive/storage.py
- gajim/gtk/search_view.py


Changes:

=====================================
gajim/common/storage/archive/storage.py
=====================================
@@ -15,7 +15,6 @@
 from __future__ import annotations
 
 from typing import Any
-from typing import NamedTuple
 
 import calendar
 import datetime
@@ -579,7 +578,7 @@ def get_days_containing_messages(self,
                                      jid: str,
                                      year: int,
                                      month: int
-                                     ) -> list[HistoryDayRow]:
+                                     ) -> list[int]:
         '''
         Get days in month of year where messages for account/jid exist
         '''
@@ -601,8 +600,8 @@ def get_days_containing_messages(self,
             message.timestamp BETWEEN ? AND ?
             ORDER BY message.timestamp
             '''
-        return self._con.execute(
-            stmt, (jid_ek, account_ek, start_ts, end_ts)).fetchall()
+        return [row.day for row in self._con.execute(
+            stmt, (jid_ek, account_ek, start_ts, end_ts)).fetchall()]
 
     @timeit
     def get_last_history_ts(self,


=====================================
gajim/gtk/search_view.py
=====================================
@@ -244,8 +244,8 @@ def _on_month_changed(self, calendar: Gtk.Calendar) -> None:
 
         history_days = app.storage.archive.get_days_containing_messages(
             self._account, self._jid, year, month)
-        for date in history_days:
-            calendar.mark_day(date.day)
+        for day in history_days:
+            calendar.mark_day(day)
 
     def _on_date_selected(self, calendar: Gtk.Calendar) -> None:
         year, month, day = calendar.get_date()



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/4a98afa4a482db39190af9060b7649fd2d334cf3

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/4a98afa4a482db39190af9060b7649fd2d334cf3
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to