Philipp Hörist pushed to branch master at gajim / gajim


Commits:
bc8f4f15 by Philipp Hörist at 2025-11-19T21:45:18+01:00
refactor: Events: Remove obsolete event

- - - - -
00cef5df by Philipp Hörist at 2025-11-19T21:45:18+01:00
fix: SyncHistory: Don’t use idle add to set fraction

This makes not much sense because we are not calling from another thread.
Because this method is potentially called thousands of times (depending on
how much messages we download from the server), the overhead of the idle_add()
call causes CPU spikes.

- - - - -


3 changed files:

- gajim/common/events.py
- gajim/common/modules/message.py
- gajim/gtk/history_sync.py


Changes:

=====================================
gajim/common/events.py
=====================================
@@ -414,14 +414,6 @@ class MucDiscoUpdate(ApplicationEvent):
     jid: JID
 
 
-@dataclass
-class RawMessageReceived(ApplicationEvent):
-    name: str = field(init=False, default='raw-message-received')
-    account: str
-    stanza: Any
-    conn: 'Client'
-
-
 @dataclass
 class RawMamMessageReceived(ApplicationEvent):
     name: str = field(init=False, default='raw-mam-message-received')


=====================================
gajim/common/modules/message.py
=====================================
@@ -24,7 +24,6 @@
 from gajim.common.events import MessageReceived
 from gajim.common.events import MessageRetracted
 from gajim.common.events import MessageSent
-from gajim.common.events import RawMessageReceived
 from gajim.common.events import ReactionUpdated
 from gajim.common.modules.base import BaseModule
 from gajim.common.modules.contacts import GroupchatParticipant
@@ -109,11 +108,6 @@ def _message_received(self,
 
         self._log.info('Received from %s', stanza.getFrom())
 
-        app.ged.raise_event(RawMessageReceived(
-            conn=self._con,
-            stanza=stanza,
-            account=self._account))
-
         if properties.carbon is not None and properties.carbon.is_sent:
             # Ugly, we treat the from attr as the remote jid,
             # to make that work with sent carbons we have to do this.


=====================================
gajim/gtk/history_sync.py
=====================================
@@ -185,8 +185,7 @@ def _mam_message_received(self, event: 
RawMamMessageReceived) -> None:
             return
 
         log.debug("Received message")
-        progress_page = self.get_page("progress")
-        GLib.idle_add(progress_page.set_fraction)
+        self.get_page("progress").set_fraction()
 
 
 class SelectTime(Page):



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/compare/79da2b8104da2222656959422274889902d32227...00cef5df47c6b22b790f99fa4f89dca6ae4e1dfc

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/compare/79da2b8104da2222656959422274889902d32227...00cef5df47c6b22b790f99fa4f89dca6ae4e1dfc
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