Philipp Hörist pushed to branch master at gajim / gajim
Commits:
ed50151e by lovetox at 2022-01-26T20:09:59+01:00
ConversationView: Don’t allow to focus rows
This can steal focus from the text and hinder users to copy text
- - - - -
1 changed file:
- gajim/gtk/conversation/rows/base.py
Changes:
=====================================
gajim/gtk/conversation/rows/base.py
=====================================
@@ -41,6 +41,7 @@ def __init__(self, account: str, widget: Optional[str] = None) -> None:
self.text: str = ''
self._merged: bool = False
+ self.set_can_focus(False)
self.get_style_context().add_class('conversation-row')
self.grid = Gtk.Grid(row_spacing=3, column_spacing=12)
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/ed50151e036b8fda6580e2fadeef5b9a…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/ed50151e036b8fda6580e2fadeef5b9a…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
12c20823 by lovetox at 2022-01-25T22:59:16+01:00
Notifications: Add code comment
- - - - -
45585811 by lovetox at 2022-01-25T23:06:14+01:00
PlainWidget: Use open_uri() to open links
- - - - -
2 changed files:
- gajim/gtk/conversation/plain_widget.py
- gajim/gtk/notification.py
Changes:
=====================================
gajim/gtk/conversation/plain_widget.py
=====================================
@@ -86,6 +86,7 @@ def __init__(self, account: str, selectable: bool) -> None:
self.get_style_context().add_class('gajim-conversation-text')
self.connect('populate-popup', self._on_populate_popup)
+ self.connect('activate-link', self._on_activate_link)
def _on_populate_popup(self, label: Gtk.Label, menu: Gtk.Menu) -> None:
selected, start, end = label.get_selection_bounds()
@@ -118,6 +119,10 @@ def add_action_phrase(self, text: str) -> None:
def update_text_tags(self) -> None:
pass
+ def _on_activate_link(self, _label: Gtk.Label, uri: str) -> int:
+ open_uri(uri, self._account)
+ return Gdk.EVENT_STOP
+
class MessageTextview(Gtk.TextView):
def __init__(self, account: str) -> None:
=====================================
gajim/gtk/notification.py
=====================================
@@ -253,6 +253,11 @@ def __init__(self):
def _detect_dbus_caps(self) -> None:
if app.is_flatpak() or app.desktop_env == 'gnome':
+ # Gnome Desktop does not use org.freedesktop.Notifications.
+ # It has its own API at org.gtk.Notifications, which is not an
+ # implementation of the freedesktop spec. There is no documentation
+ # on what it currently supports, we can assume at least what the
+ # GLib.Notification API offers (icons, actions).
self._caps = ['actions']
self._dbus_available = True
return
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/compare/58aaa25098197c1fcdac80ec523685b…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/compare/58aaa25098197c1fcdac80ec523685b…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
58aaa250 by lovetox at 2022-01-25T22:24:13+01:00
Notifications: Escape markup in body only if body-markup is supported
- Gnome does not support body-markup
- Title should not be escaped
- - - - -
1 changed file:
- gajim/gtk/notification.py
Changes:
=====================================
gajim/gtk/notification.py
=====================================
@@ -247,11 +247,13 @@ class Linux(NotificationBackend):
def __init__(self):
NotificationBackend.__init__(self)
self._dbus_available: bool = False
- self._daemon_capabilities = ['actions']
+ self._caps: list[str] = []
self._detect_dbus_caps()
+ log.info('Detected notification capabilities: %s', self._caps)
def _detect_dbus_caps(self) -> None:
- if app.is_flatpak():
+ if app.is_flatpak() or app.desktop_env == 'gnome':
+ self._caps = ['actions']
self._dbus_available = True
return
@@ -259,7 +261,7 @@ def on_proxy_ready(_source: Gio.DBusProxy,
res: Gio.AsyncResult) -> None:
try:
proxy = Gio.DBusProxy.new_finish(res)
- self._daemon_capabilities = proxy.GetCapabilities() # type: ignore
+ self._caps = proxy.GetCapabilities() # type: ignore
except GLib.Error as error:
log.warning('Notifications D-Bus not available: %s', error)
else:
@@ -282,8 +284,13 @@ def _send(self, event: events.Notification) -> None:
notification = Gio.Notification()
if event.title is not None:
- notification.set_title(GLib.markup_escape_text(event.title))
- notification.set_body(GLib.markup_escape_text(event.text))
+ notification.set_title(event.title)
+
+ text = event.text
+ if 'body-markup' in self._caps:
+ text = GLib.markup_escape_text(event.text)
+
+ notification.set_body(text)
notification.set_priority(Gio.NotificationPriority.NORMAL)
icon = self._make_icon(event)
@@ -302,7 +309,7 @@ def _add_actions(self,
if event.type not in self._action_types:
return
- if 'actions' not in self._daemon_capabilities:
+ if 'actions' not in self._caps:
return
jid = ''
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/58aaa25098197c1fcdac80ec523685b4…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/58aaa25098197c1fcdac80ec523685b4…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch gajim_1.3 at gajim / gajim
Commits:
e98cf336 by ValdikSS at 2021-12-15T03:13:02+03:00
Backport jingle-initiator, fixes jingle file transfer from Conversations
Conversations XMPP client does not include initiator attribute in Jingle
connection stanza, while Gajim 1.3 expects it and fails to accept the
file or even show the file transfer dialog without it.
- - - - -
1 changed file:
- gajim/common/jingle_session.py
Changes:
=====================================
gajim/common/jingle_session.py
=====================================
@@ -516,7 +516,17 @@ def __on_session_initiate(self, stanza, jingle, error, action):
"""
if self.state != JingleStates.ENDED:
raise OutOfOrder
- self.initiator = jingle['initiator']
+
+ # In "session-initiate", the <jingle/> element SHOULD possess an
+ # 'initiator' attribute. If it differs from the JID 'from', jingle
+ # 'initiator' SHOULD be ignored.
+ if jingle['initiator'] is None:
+ self.initiator = str(stanza['from'])
+ elif str(jingle['initiator']) != str(stanza['from']):
+ self.initiator = str(stanza['from'])
+ else:
+ self.initiator = str(jingle['initiator'])
+
self.responder = self.ourjid
self.peerjid = self.initiator
self.accepted = False # user did not accept this session yet
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/e98cf3367c962c8de4345e27ff09e68f…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/e98cf3367c962c8de4345e27ff09e68f…
You're receiving this email because of your account on dev.gajim.org.