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


Commits:
033080b2 by wurstsalat at 2022-07-20T20:46:15+02:00
MessageInputTextView: Remove 'correcting' class after sending message

- - - - -


4 changed files:

- gajim/gtk/chat_stack.py
- gajim/gtk/controls/base.py
- gajim/gtk/controls/chat.py
- gajim/gtk/controls/groupchat.py


Changes:

=====================================
gajim/gtk/chat_stack.py
=====================================
@@ -563,6 +563,8 @@ def _on_send_message(self) -> None:
         client.send_message(message_)
 
         self._message_action_box.msg_textview.clear()
+        self._message_action_box.msg_textview.get_style_context().remove_class(
+            'gajim-msg-correcting')
 
     def _close_control(self) -> None:
         assert self._current_contact is not None


=====================================
gajim/gtk/controls/base.py
=====================================
@@ -183,7 +183,6 @@ def __init__(self, widget_name: str, account: str, jid: 
JID) -> None:
         self.last_msg_id: Optional[str] = None
 
         # XEP-0308 Message Correction
-        self.correcting: bool = False
         self.last_sent_msg: Optional[str] = None
 
         # XEP-0172 User Nickname
@@ -292,18 +291,22 @@ def _on_conversation_view_key_press(self,
 
     @property
     def type(self) -> ControlType:
+        assert self._type is not None
         return self._type
 
     @property
     def is_chat(self) -> bool:
+        assert self._type is not None
         return self._type.is_chat
 
     @property
     def is_privatechat(self) -> bool:
+        assert self._type is not None
         return self._type.is_privatechat
 
     @property
     def is_groupchat(self) -> bool:
+        assert self._type is not None
         return self._type.is_groupchat
 
     def _on_ping_event(self, event: events.PingEventT) -> None:


=====================================
gajim/gtk/controls/chat.py
=====================================
@@ -74,7 +74,6 @@ def __init__(self, account: str, jid: JID) -> None:
         self.sendmessage: bool = True
 
         # XEP-0308 Message Correction
-        self.correcting: bool = False
         self.last_sent_msg: Optional[str] = None
 
         # PluginSystem: adding GUI extension point for this ChatControl
@@ -146,10 +145,6 @@ def _on_message_sent(self, event: events.MessageSent) -> 
None:
             displaymarking = event.label.displaymarking
         else:
             displaymarking = None
-        if self.correcting:
-            self.correcting = False
-            self.msg_textview.get_style_context().remove_class(
-                'gajim-msg-correcting')
 
         if event.correct_id:
             self.conversation_view.correct_message(


=====================================
gajim/gtk/controls/groupchat.py
=====================================
@@ -89,7 +89,6 @@ def __init__(self, account: str, jid: JID) -> None:
         self.sendmessage: bool = False
 
         # XEP-0308 Message Correction
-        self.correcting: bool = False
         self.last_sent_msg: Optional[str] = None
 
         self._groupchat_state = GroupchatState(self.contact)
@@ -645,10 +644,6 @@ def _on_message_sent(self, event: events.MessageSent) -> 
None:
                 self.last_sent_msg = None
             else:
                 self.last_sent_msg = event.message_id
-        if self.correcting:
-            self.correcting = False
-            self.msg_textview.get_style_context().remove_class(
-                'gajim-msg-correcting')
 
     def _on_message_error(self, event: events.MessageError) -> None:
         self.conversation_view.show_error(event.message_id, event.error)



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/033080b26d7d426f2e607550ae9e7626ba6f676b

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