Philipp Hörist pushed to branch master at gajim / gajim
Commits:
-
ef52d49b
by lovetox at 2022-01-24T14:13:10+01:00
3 changed files:
Changes:
| ... | ... | @@ -750,8 +750,9 @@ def _on_open_event_action(_action: Gio.SimpleAction, |
| 750 | 750 |
'incoming-call',
|
| 751 | 751 |
'file-transfer'):
|
| 752 | 752 |
|
| 753 |
- assert params.jid is not None
|
|
| 754 |
- app.window.select_chat(params.account, params.jid)
|
|
| 753 |
+ assert params.jid
|
|
| 754 |
+ jid = JID.from_string(params.jid)
|
|
| 755 |
+ app.window.select_chat(params.account, jid)
|
|
| 755 | 756 |
|
| 756 | 757 |
app.window.present_with_time(Gtk.get_current_event_time())
|
| 757 | 758 |
|
| ... | ... | @@ -212,12 +212,13 @@ def _on_button_press(self, |
| 212 | 212 |
event: Gdk.EventButton
|
| 213 | 213 |
) -> None:
|
| 214 | 214 |
if event.button == 1:
|
| 215 |
- jid = self._event.jid
|
|
| 216 |
- if jid is not None and isinstance(jid, str):
|
|
| 217 |
- jid = JID.from_string(jid)
|
|
| 215 |
+ |
|
| 216 |
+ jid = ''
|
|
| 217 |
+ if self._event.jid is not None:
|
|
| 218 |
+ jid = str(self._event.jid)
|
|
| 218 | 219 |
|
| 219 | 220 |
params = OpenEventActionParams(type=self._event.type,
|
| 220 |
- sub_type=self._event.sub_type,
|
|
| 221 |
+ sub_type=self._event.sub_type or '',
|
|
| 221 | 222 |
account=self._event.account,
|
| 222 | 223 |
jid=jid)
|
| 223 | 224 |
app.app.activate_action(f'app.{self._event.account}-open-event',
|
| ... | ... | @@ -304,12 +305,12 @@ def _add_actions(self, |
| 304 | 305 |
if 'actions' not in self._daemon_capabilities:
|
| 305 | 306 |
return
|
| 306 | 307 |
|
| 307 |
- jid = event.jid
|
|
| 308 |
- if jid is not None and isinstance(jid, str):
|
|
| 309 |
- jid = JID.from_string(jid)
|
|
| 308 |
+ jid = ''
|
|
| 309 |
+ if event.jid is not None:
|
|
| 310 |
+ jid = str(event.jid)
|
|
| 310 | 311 |
|
| 311 | 312 |
params = OpenEventActionParams(type=event.type,
|
| 312 |
- sub_type=event.sub_type,
|
|
| 313 |
+ sub_type=event.sub_type or '',
|
|
| 313 | 314 |
account=event.account,
|
| 314 | 315 |
jid=jid)
|
| 315 | 316 |
|
| ... | ... | @@ -31,10 +31,12 @@ |
| 31 | 31 |
|
| 32 | 32 |
@dataclass
|
| 33 | 33 |
class OpenEventActionParams(VariantMixin):
|
| 34 |
+ # Event which is used for Notifications and gets sent over DBus
|
|
| 35 |
+ # Don’t use Optional types here because DBus does not support "None"
|
|
| 34 | 36 |
type: str
|
| 35 |
- sub_type: Optional[str]
|
|
| 37 |
+ sub_type: str
|
|
| 36 | 38 |
account: str
|
| 37 |
- jid: Optional[JID]
|
|
| 39 |
+ jid: str
|
|
| 38 | 40 |
|
| 39 | 41 |
|
| 40 | 42 |
@dataclass
|