Philipp Hörist pushed to branch master at gajim / gajim
Commits:
90f380d1 by André Apitzsch at 2022-03-06T13:06:55+01:00
Styling: Remove superfluous empty line after preformatted text
The text block might contain a newline after the closing ```.
Remove it, so that `text.partition('\n')[2][:-4]` returns the expected
substring.
Fixes #10787.
- - - - -
1 changed file:
- gajim/gtk/conversation/code_widget.py
Changes:
=====================================
gajim/gtk/conversation/code_widget.py
=====================================
@@ -82,6 +82,7 @@ def add_content(self, block: PreBlock):
@staticmethod
def _prepare_code(text: str) -> Tuple[str, Optional[str]]:
+ text = text.strip()
code_start = text.partition('\n')[0]
lang = None
if len(code_start) > 3:
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/90f380d13e1c2fcd5df8e73571082893…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/90f380d13e1c2fcd5df8e73571082893…
You're receiving this email because of your account on dev.gajim.org.
Daniel Brötzmann pushed to branch master at gajim / gajim
Commits:
0dbbf715 by André Apitzsch at 2022-03-04T22:07:10+01:00
Fix highlighting of email addresses
Fixes #10788.
- - - - -
2 changed files:
- gajim/common/styling.py
- test/no_gui/test_styling.py
Changes:
=====================================
gajim/common/styling.py
=====================================
@@ -46,7 +46,7 @@
URI_RX = r'((?P<protocol>[\w-]+://?|www[.])[\S()<>]+?(?=[,]?(\s|\Z)+))'
URI_RX = re.compile(URI_RX)
-ADDRESS_RX = r'(\b(?P<protocol>(xmpp|mailto)+:)?[\w-]*@(.*?\.)+[\w]+([\?].*?(?=([\s\),]|$)))?)'
+ADDRESS_RX = r'(\b(?P<protocol>(xmpp|mailto):)?[\w-]*@(\w*?\.)+[\w]+([\?].*?(?=([\s\),]|$)))?)'
ADDRESS_RX = re.compile(ADDRESS_RX)
EMOJI_RX = emoji_data.get_regex()
=====================================
test/no_gui/test_styling.py
=====================================
@@ -325,6 +325,14 @@
EMAILS = [
'asd(a)asd.at',
'asd(a)asd.asd.at',
+ 'mailto:foo@bar.com.uk',
+]
+
+EMAILS_WITH_TEXT = [
+ ('write to my email mailto:foo@bar.com.uk (but not to mailto:bar@foo.com)',
+ ['mailto:foo@bar.com.uk', 'mailto:bar@foo.com']),
+ ('write to my email mailtomailto:foo@bar.com.uk (but not to mailto:bar@foo.com)',
+ ['foo(a)bar.com.uk', 'mailto:bar@foo.com']),
]
@@ -360,6 +368,13 @@ def test_emails(self):
end = match.end()
self.assertTrue(email[start:end] == email)
+ def test_emails_with_text(self):
+ for text, result in EMAILS_WITH_TEXT:
+ match = ADDRESS_RX.findall(text)
+ self.assertIsNotNone(match)
+ for i, res in enumerate(result):
+ self.assertTrue(match[i][0] == res)
+
def test_url_with_text(self):
for text, result in URL_WITH_TEXT:
match = URI_RX.search(text)
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/0dbbf715fc2196cff67cd55fc2bd39b9…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/0dbbf715fc2196cff67cd55fc2bd39b9…
You're receiving this email because of your account on dev.gajim.org.
Daniel Brötzmann pushed to branch master at gajim / gajim
Commits:
b0b20026 by wurstsalat at 2022-03-02T21:53:34+01:00
ContactInfo: Add explanation for hiding Notes page
- - - - -
8bb86ec4 by wurstsalat at 2022-03-02T22:02:02+01:00
Commands: Fix deprecation warning
- - - - -
4b6a2433 by wurstsalat at 2022-03-02T22:25:49+01:00
Command System: Fix /leave command
Fixes #10762
- - - - -
3 changed files:
- gajim/command_system/framework.py
- gajim/command_system/implementation/standard.py
- gajim/gtk/contact_info.py
Changes:
=====================================
gajim/command_system/framework.py
=====================================
@@ -20,7 +20,8 @@
"""
from types import FunctionType
-from inspect import getargspec, getdoc
+from inspect import getfullargspec
+from inspect import getdoc
from gajim.command_system.dispatcher import Host
from gajim.command_system.dispatcher import Container
@@ -221,7 +222,8 @@ def extract_specification(self):
Extract handler's arguments specification, as it was defined
preserving their order.
"""
- names, var_args, var_kwargs, defaults = getargspec(self.handler) # pylint: disable=W1505
+ names, var_args, var_kwargs, defaults, _, _, _ = getfullargspec(
+ self.handler)
# Behavior of this code need to be checked. Might yield
# incorrect results on some rare occasions.
=====================================
gajim/command_system/implementation/standard.py
=====================================
@@ -334,11 +334,12 @@ def join(self, jid):
'groupchat-join',
GLib.Variant('as', [self.account, jid]))
- @command('part', 'close', raw=True, empty=True)
- @doc(_("Leave the group chat, optionally giving a reason, and close tab or "
- "window"))
- def leave(self, reason):
- self.leave(reason=reason)
+ @command('part', 'close')
+ @doc(_("Leave the group chat"))
+ def leave(self):
+ # Use idle_add to let command system finish printing
+ variant = GLib.Variant('as', [self.account, str(self.room_jid)])
+ GLib.idle_add(app.window.activate_action, 'remove-chat', variant)
@command(raw=True, empty=True)
@doc(_("""
=====================================
gajim/gtk/contact_info.py
=====================================
@@ -186,6 +186,10 @@ def _fill_note_page(self, contact: BareContact) -> None:
self._ui.textview_annotation.get_buffer().set_text(note.data)
if app.account_supports_private_storage(self.account):
+ # Hide the Notes page if private storage is not available, because
+ # roster notes cannot be stored without.
+ # Since there is no disco mechanism for private storage, we rely on
+ # Delimiter as a "proxy" for the availability of private storage.
self._switcher.set_row_visible('notes', True)
def _fill_settings_page(self, contact: BareContact) -> None:
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/compare/e551b33ee207321fccc91693fd86806…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/compare/e551b33ee207321fccc91693fd86806…
You're receiving this email because of your account on dev.gajim.org.