[Git][gajim/gajim][mainwindow] Fix read markers in groupchat
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: a8dbc2d9 by lovetox at 2021-06-01T22:03:22+02:00 Fix read markers in groupchat - - - - - 1 changed file: - gajim/common/modules/chat_markers.py Changes: = gajim/common/modules/chat_markers.py = @@ -52,7 +52,7 @@ def _process_chat_marker(self, _con, _stanza, properties): self._log.warning('Received chat marker while not joined') return -if properties.muc_nickname != muc_data.nick: +if properties.muc_nickname != contact.nickname: return self._raise_event('read-state-sync', properties) View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/a8dbc2d9bd31ebae8ba3395e1743da3f80fa83e9 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/a8dbc2d9bd31ebae8ba3395e1743da3f80fa83e9 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/python-nbxmpp][master] AdHoc: Don’t expect session id for one stage commands
Philipp Hörist pushed to branch master at gajim / python-nbxmpp Commits: 589fd699 by lovetox at 2021-05-27T20:38:15+02:00 AdHoc: Don’t expect session id for one stage commands - - - - - 1 changed file: - nbxmpp/modules/adhoc.py Changes: = nbxmpp/modules/adhoc.py = @@ -66,18 +66,18 @@ class AdHoc(BaseModule): yield command_list @iq_request_task -def execute_command(self, command, action=None, dataform=None): +def execute_command(self, cmd, action=None, dataform=None): _task = yield if action is None: action = AdHocAction.EXECUTE -attrs = {'node': command.node, +attrs = {'node': cmd.node, 'xmlns': Namespace.COMMANDS, 'action': action.value} -if command.sessionid is not None: -attrs['sessionid'] = command.sessionid +if cmd.sessionid is not None: +attrs['sessionid'] = cmd.sessionid -response = yield _make_command(command, attrs, dataform) +response = yield _make_command(cmd, attrs, dataform) if response.isError(): raise StanzaError(response) @@ -89,10 +89,6 @@ class AdHoc(BaseModule): if node is None: raise MalformedStanzaError('node attribute missing', response) -sessionid = command.getAttr('sessionid') -if sessionid is None: -raise MalformedStanzaError('sessionid attribute missing', response) - status = command.getAttr('status') if status is None: raise MalformedStanzaError('status attribute missing', response) @@ -103,6 +99,10 @@ class AdHoc(BaseModule): status = AdHocStatus(status) +sessionid = command.getAttr('sessionid') +if sessionid is None and _expect_sessionid(status, cmd.sessionid): +raise MalformedStanzaError('sessionid attribute missing', response) + try: notes = _parse_notes(command) except ValueError as error: @@ -192,3 +192,9 @@ def _parse_actions(command): default = actions[0] return actions, default + + +def _expect_sessionid(status, sent_sessionid): +# Session id should only be expected for multiple stage commands +# or when we initialize the session (set the session attribute) +return status != status.COMPLETED or sent_sessionid is not None View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/-/commit/589fd69983bac85a6947004e010f3e22b5cb5053 -- View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/-/commit/589fd69983bac85a6947004e010f3e22b5cb5053 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] Fix Status Message Dialog
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: 790ec5b9 by lovetox at 2021-05-23T21:06:14+02:00 Fix Status Message Dialog - - - - - 1 changed file: - gajim/gtk/status_change.py Changes: = gajim/gtk/status_change.py = @@ -542,17 +542,14 @@ def _send_user_activity(self): def _send_status_and_message(self, message): if self.account is not None: -app.interface.roster.send_status(self.account, - self._status, - message) +app.get_client(self.account).change_status(self._status, message) return for account in app.connections: if not app.settings.get_account_setting( account, 'sync_with_global_status'): continue - -app.interface.roster.send_status(account, self._status, message) +app.get_client(account).change_status(self._status, message) def _change_status(self, *args): self.stop_timeout() View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/790ec5b9edfb9cba6a11f6dedfbf90627b226576 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/790ec5b9edfb9cba6a11f6dedfbf90627b226576 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] Diplay name of domain jids correctly
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: ebddaa65 by lovetox at 2021-05-23T19:23:48+02:00 Diplay name of domain jids correctly - - - - - 1 changed file: - gajim/common/modules/contacts.py Changes: = gajim/common/modules/contacts.py = @@ -222,6 +222,8 @@ def name(self): nickname = app.storage.cache.get_contact(self._jid, 'nickname') if nickname: return nickname +if self._jid.is_domain: +return self._jid.domain return self._jid.localpart @property View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/ebddaa656dcc53c6f951ac092609a9f79422f973 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/ebddaa656dcc53c6f951ac092609a9f79422f973 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] GroupchatRoster: Don’t fail showing menu
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: bea60842 by lovetox at 2021-05-19T23:58:55+02:00 GroupchatRoster: Don’t fail showing menu - - - - - 1 changed file: - gajim/gtk/groupchat_roster.py Changes: = gajim/gtk/groupchat_roster.py = @@ -298,7 +298,7 @@ def _on_roster_button_press_event(self, treeview, event): return nick = self._store[iter_][Column.NICK_OR_GROUP] -if self._control.nick == nick: +if self._group_chat_contact.nickname == nick: return if event.button == 3: # right click @@ -308,7 +308,7 @@ def _on_roster_button_press_event(self, treeview, event): self.emit('row-activated', nick) def _show_contact_menu(self, nick): -self_contact = self._group_chat_contact.get_resource(self._control.nick) +self_contact = self._group_chat_contact.get_self() contact = self._group_chat_contact.get_resource(nick) menu = get_groupchat_roster_menu(self._account, self._control_id, View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/bea60842a4619e3625ea3226fae2bae7ba6e31f1 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/bea60842a4619e3625ea3226fae2bae7ba6e31f1 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] Fix choosing a different nick on second join
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: 717a6b52 by lovetox at 2021-05-19T23:50:12+02:00 Fix choosing a different nick on second join - - - - - 1 changed file: - gajim/common/modules/muc.py Changes: = gajim/common/modules/muc.py = @@ -210,6 +210,12 @@ def join(self, jid, nick=None, password=None, config=None): self._mucs[jid] = muc_data self._push_muc_added_event(jid) +elif nick is not None: +# Currently MUCData is never discarded so if it exists it contains +# the nickname of a previous join. The user may chose now on a new +# join a different nickname, so update MUCData here. +muc_data.nick = nick + if not muc_data.state.is_not_joined: self._log.warning('Can’t join MUC %s, state: %s', jid, muc_data.state) View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/717a6b52dd10ce53dabff6c73b12e2cc6ef6642d -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/717a6b52dd10ce53dabff6c73b12e2cc6ef6642d You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][master] 3 commits: PortableInstaller: Add directory cleanup
Philipp Hörist pushed to branch master at gajim / gajim Commits: 1f0a3158 by wurstsalat at 2021-05-14T21:37:09+02:00 PortableInstaller: Add directory cleanup - - - - - 20ebd79e by wurstsalat at 2021-05-14T21:37:09+02:00 Uninstaller: Kill gdbus.exe if running - - - - - 055308ec by wurstsalat at 2021-05-14T21:37:09+02:00 Installer: Add Gajim branding text - - - - - 2 changed files: - win/misc/gajim-portable.nsi - win/misc/gajim.nsi Changes: = win/misc/gajim-portable.nsi = @@ -2,6 +2,8 @@ Unicode true !include "MUI2.nsh" +!include "LogicLib.nsh" + Name "Gajim" OutFile "Gajim-Portable.exe" @@ -12,6 +14,7 @@ SetCompressorDictSize 32 InstallDir "$PROFILE\Gajim" RequestExecutionLevel user +BrandingText "Gajim Setup" !define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\orange-install.ico" !define MUI_HEADERIMAGE @@ -51,6 +54,7 @@ LangString NAME_Languages ${LANG_ENGLISH} "Languages" LangString NAME_SecLanguagesOther ${LANG_ENGLISH} "Other" LangString NAME_Themes ${LANG_ENGLISH} "Themes" LangString DESC_SecGajim ${LANG_ENGLISH} "Installs the main Gajim files." +LangString INST_NotEmpty ${LANG_ENGLISH} "It looks like you already installed Gajim in this directory. A cleanup is necessary before installing. Your user data will not be touched. Cleanup now?" ; French @@ -60,6 +64,7 @@ LangString NAME_Languages ${LANG_FRENCH} "Langues" LangString NAME_SecLanguagesOther ${LANG_FRENCH} "Autre" LangString NAME_Themes ${LANG_FRENCH} "Thèmes" LangString DESC_SecGajim ${LANG_FRENCH} "Installer les fichiers principaux de Gajim." +LangString INST_NotEmpty ${LANG_FRENCH} "It looks like you already installed Gajim in this directory. A cleanup is necessary before installing. Your user data will not be touched. Cleanup now?" ; German @@ -69,6 +74,7 @@ LangString NAME_Languages ${LANG_GERMAN} "Sprachen" LangString NAME_SecLanguagesOther ${LANG_GERMAN} "Sonstige" LangString NAME_Themes ${LANG_GERMAN} "Designs" LangString DESC_SecGajim ${LANG_GERMAN} "Installiert die Hauptdateien von Gajim." +LangString INST_NotEmpty ${LANG_GERMAN} "Anscheinend ist Gajim bereits in diesem Verzeichnis installiert. Vor der Installation ist es notwendig das Verzeichnis aufzuräumen. Deine Benutzerdaten bleiben erhalten. Jetzt aufräumen?" ; Italian @@ -78,6 +84,7 @@ LangString NAME_Languages ${LANG_ITALIAN} "Lingue" LangString NAME_SecLanguagesOther ${LANG_ITALIAN} "Altre" LangString NAME_Themes ${LANG_ITALIAN} "Temi" LangString DESC_SecGajim ${LANG_ITALIAN} "Installa i file principali di Gajim." +LangString INST_NotEmpty ${LANG_ITALIAN} "It looks like you already installed Gajim in this directory. A cleanup is necessary before installing. Your user data will not be touched. Cleanup now?" ; Russian @@ -87,6 +94,7 @@ LangString NAME_Languages ${LANG_RUSSIAN} "Языки" LangString NAME_SecLanguagesOther ${LANG_RUSSIAN} "Другое" LangString NAME_Themes ${LANG_RUSSIAN} "Темы" LangString DESC_SecGajim ${LANG_RUSSIAN} "Установка основных файлов Gajim." +LangString INST_NotEmpty ${LANG_RUSSIAN} "It looks like you already installed Gajim in this directory. A cleanup is necessary before installing. Your user data will not be touched. Cleanup now?" ; Hebrew @@ -96,11 +104,24 @@ LangString NAME_Languages ${LANG_HEBREW} "שפות" LangString NAME_SecLanguagesOther ${LANG_HEBREW} "אחרות" LangString NAME_Themes ${LANG_HEBREW} "ערכאות נושא" LangString DESC_SecGajim ${LANG_HEBREW} "מתקין קבצי Gajim עיקריים." +LangString INST_NotEmpty ${LANG_HEBREW} "It looks like you already installed Gajim in this directory. A cleanup is necessary before installing. Your user data will not be touched. Cleanup now?" Section "Gajim" SecGajim SectionIn RO SetOutPath "$INSTDIR" + +${If} ${FileExists} "$InstDir\bin\Gajim.exe" +MessageBox MB_YESNO $(INST_NotEmpty) IDYES cleanup +Abort +cleanup: +RMDir /r "$InstDir\bin" +RMDir /r "$InstDir\etc" +RMDir /r "$InstDir\lib" +RMDir /r "$InstDir\share" +RMDir /r "$InstDir\ssl" +${EndIf} + File /r "${ARCH}\*.*" SetOutPath "$INSTDIR\bin" = win/misc/gajim.nsi = @@ -2,6 +2,7 @@ Unicode true !include "MUI2.nsh" +!include "LogicLib.nsh" Name "Gajim" OutFile "Gajim.exe" @@ -13,6 +14,7 @@ SetCompressorDictSi
[Git][gajim/gajim][master] ServerInfo: Don’t fail while adding error class
Philipp Hörist pushed to branch master at gajim / gajim Commits: ae5ec793 by lovetox at 2021-05-14T20:55:43+02:00 ServerInfo: Don’t fail while adding error class Fixes #10559 - - - - - 1 changed file: - gajim/gtk/server_info.py Changes: = gajim/gtk/server_info.py = @@ -98,7 +98,8 @@ def _add_connection_info(self): self._ui.connection_type.set_text(address.type.value) if address.type.is_plain: - self._ui.conection_type.get_style_context().add_class('error-color') +self._ui.connection_type.get_style_context().add_class( +'error-color') # Connection proxy proxy = address.proxy View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/ae5ec7938f3d917855d1485ddc967d0055fcc4ae -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/ae5ec7938f3d917855d1485ddc967d0055fcc4ae You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][master] Annotate the type for Page.__gsignals__ to fix the mypy failure
Philipp Hörist pushed to branch master at gajim / gajim Commits: 4cedb943 by Marcin Mielniczuk at 2021-05-14T11:10:51+02:00 Annotate the type for Page.__gsignals__ to fix the mypy failure - - - - - 2 changed files: - gajim/gtk/account_wizard.py - gajim/gtk/assistant.py Changes: = gajim/gtk/account_wizard.py = @@ -12,7 +12,6 @@ # You should have received a copy of the GNU General Public License # along with Gajim. If not, see <http://www.gnu.org/licenses/>. -# type: ignore import logging from gi.repository import Gdk = gajim/gtk/assistant.py = @@ -180,7 +180,7 @@ def __on_destroy(self, *args): class Page(Gtk.Box): -__gsignals__ = { +__gsignals__: dict = { 'update-page-complete': (GObject.SignalFlags.RUN_LAST, None, ()), } View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/4cedb943d5ca8366547c159ea77e7f7023c51c06 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/4cedb943d5ca8366547c159ea77e7f7023c51c06 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][master] Fix CI
Philipp Hörist pushed to branch master at gajim / gajim Commits: debab37e by lovetox at 2021-05-11T22:38:43+02:00 Fix CI - - - - - 1 changed file: - gajim/gtk/account_wizard.py Changes: = gajim/gtk/account_wizard.py = @@ -12,6 +12,7 @@ # You should have received a copy of the GNU General Public License # along with Gajim. If not, see <http://www.gnu.org/licenses/>. +# type: ignore import logging from gi.repository import Gdk @@ -50,7 +51,6 @@ from .util import get_builder from .util import open_window - log = logging.getLogger('gajim.gui.account_wizard') View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/debab37e3721871b16af6b6edbb86d6862a5dcc2 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/debab37e3721871b16af6b6edbb86d6862a5dcc2 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][master] Update runtime requirements
Philipp Hörist pushed to branch master at gajim / gajim Commits: 242791e3 by lovetox at 2021-05-08T12:41:22+02:00 Update runtime requirements - - - - - 2 changed files: - README.md - setup.cfg Changes: = README.md = @@ -13,6 +13,7 @@ ### Runtime Requirements - python3-keyring - python3-precis-i18n - python3-packaging +- python3-setuptools - gir1.2-soup-2.4 - GLib (>=2.60.0) = setup.cfg = @@ -24,6 +24,7 @@ install_requires = keyring nbxmpp>=2.0.1 packaging +setuptools precis-i18n>=1.0.0 pyOpenSSL>=16.2 pycairo>=1.16.0 View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/242791e38fefa25b091da524a39c294cc293f462 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/242791e38fefa25b091da524a39c294cc293f462 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/python-nbxmpp][master] 2 commits: GSSAPI: Catch OSError
Philipp Hörist pushed to branch master at gajim / python-nbxmpp Commits: a8edce24 by lovetox at 2021-05-08T12:24:06+02:00 GSSAPI: Catch OSError Error is thrown when Kerberos for Windows is not installed - - - - - 73c4352f by lovetox at 2021-05-08T12:24:38+02:00 Update README.md - - - - - 2 changed files: - README.md - nbxmpp/auth.py Changes: = README.md = @@ -13,7 +13,7 @@ ## Optional Runtime Requirements -- python-gssapi (for GSSAPI authentication) +- python-gssapi (for GSSAPI authentication https://pypi.org/project/gssapi/) ## Features = nbxmpp/auth.py = @@ -37,7 +37,8 @@ log = logging.getLogger('nbxmpp.auth') try: gssapi = __import__('gssapi') GSSAPI_AVAILABLE = True -except ImportError: +except (ImportError, OSError) as error: +log.warning('GSSAPI not available: %s', error) GSSAPI_AVAILABLE = False View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/-/compare/6e3bc1655ed7210a9ef86fdb645c67d5c0693ce4...73c4352f706ed9a9bea0ec577065995844338ced -- View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/-/compare/6e3bc1655ed7210a9ef86fdb645c67d5c0693ce4...73c4352f706ed9a9bea0ec577065995844338ced You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/python-nbxmpp][master] AdHoc: Cancel action is always possible
Philipp Hörist pushed to branch master at gajim / python-nbxmpp Commits: 6e3bc165 by lovetox at 2021-05-03T22:52:55+02:00 AdHoc: Cancel action is always possible - - - - - 1 changed file: - nbxmpp/modules/adhoc.py Changes: = nbxmpp/modules/adhoc.py = @@ -150,12 +150,15 @@ def _parse_notes(command): def _parse_actions(command): +if command.getAttr('status') != 'executing': +return [], None + actions_node = command.getTag('actions') if actions_node is None: # If there is no element, # the user-agent can use a single-stage dialog or view. # The action "execute" is equivalent to the action "complete". -return [AdHocAction.COMPLETE], AdHocAction.COMPLETE +return [AdHocAction.CANCEL, AdHocAction.COMPLETE], AdHocAction.COMPLETE actions = [] for action in actions_node.getChildren(): @@ -167,6 +170,9 @@ def _parse_actions(command): if not actions: raise ValueError('actions element without actions') +# The action "cancel" is always allowed. +actions.append(AdHocAction.CANCEL) + default = actions_node.getAttr('execute') if default is None: # If the "execute" attribute is absent, it defaults to "next". View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/-/commit/6e3bc1655ed7210a9ef86fdb645c67d5c0693ce4 -- View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/-/commit/6e3bc1655ed7210a9ef86fdb645c67d5c0693ce4 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][master] 2 commits: AdHoc: There is always a default action
Philipp Hörist pushed to branch master at gajim / gajim Commits: 384bed1e by lovetox at 2021-05-03T22:31:10+02:00 AdHoc: There is always a default action - - - - - 5685a7c7 by lovetox at 2021-05-03T23:00:36+02:00 AdHoc: Don’t add cancel action nbxmpp provides it already - - - - - 1 changed file: - gajim/gtk/adhoc.py Changes: = gajim/gtk/adhoc.py = @@ -297,12 +297,9 @@ def _on_is_valid(self, _widget, is_valid): def get_visible_buttons(self): actions = list(map(lambda action: action.value, self._last_stage_data.actions)) -actions.append('cancel') return actions def get_default_button(self): -if self._last_stage_data.default is None: -return None return self._last_stage_data.default.value View it on GitLab: https://dev.gajim.org/gajim/gajim/-/compare/3d87009dd904a3b5e731e41f7a996f760f0896a5...5685a7c7a5d2d06f7df4a6e6e40d2948beebe6a5 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/compare/3d87009dd904a3b5e731e41f7a996f760f0896a5...5685a7c7a5d2d06f7df4a6e6e40d2948beebe6a5 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/python-nbxmpp][master] AdHoc: Improve XEP-0050 Compliance
Philipp Hörist pushed to branch master at gajim / python-nbxmpp Commits: 7449bbdf by lovetox at 2021-05-03T22:26:16+02:00 AdHoc: Improve XEP-0050 Compliance - - - - - 1 changed file: - nbxmpp/modules/adhoc.py Changes: = nbxmpp/modules/adhoc.py = @@ -85,41 +85,44 @@ class AdHoc(BaseModule): if command is None: raise MalformedStanzaError('command node missing', response) -attrs = command.getAttrs() -notes = [] -actions = [] +node = command.getAttr('node') +if node is None: +raise MalformedStanzaError('node attribute missing', response) + +sessionid = command.getAttr('sessionid') +if sessionid is None: +raise MalformedStanzaError('sessionid attribute missing', response) + +status = command.getAttr('status') +if status is None: +raise MalformedStanzaError('status attribute missing', response) + +if status not in ('executing', 'completed', 'canceled'): +raise MalformedStanzaError('invalid status attribute %s' % status, + response) + +status = AdHocStatus(status) + try: -for note in command.getTags('note'): -type_ = note.getAttr('type') -if type_ is not None: -type_ = AdHocNoteType(note.getAttr('type')) -notes.append(AdHocCommandNote(text=note.getData(), - type=type_)) - -default = None -actions_ = command.getTag('actions') -if actions_ is not None: -for action_ in actions_.getChildren(): -actions.append(AdHocAction(action_.getName())) - -default = actions_.getAttr('execute') -if default is not None: -default = AdHocAction(default) -if default not in actions: -default = None - -yield AdHocCommand( -jid=str(response.getFrom()), -name=None, -node=attrs['node'], -sessionid=attrs.get('sessionid'), -status=AdHocStatus(attrs['status']), -data=command.getTag('x', namespace=Namespace.DATA), -actions=actions, -default=default, -notes=notes) -except Exception as error: -raise MalformedStanzaError(str(error), response) +notes = _parse_notes(command) +except ValueError as error: +raise MalformedStanzaError(error, response) + +try: +actions, default = _parse_actions(command) +except ValueError as error: +raise MalformedStanzaError(error, response) + +yield AdHocCommand( +jid=response.getFrom(), +name=None, +node=node, +sessionid=sessionid, +status=status, +data=command.getTag('x', namespace=Namespace.DATA), +actions=actions, +default=default, +notes=notes) def _make_command(command, attrs, dataform): @@ -129,3 +132,57 @@ def _make_command(command, attrs, dataform): iq = Iq('set', to=command.jid) iq.addChild(node=command_node) return iq + + +def _parse_notes(command): +notes = [] +for note in command.getTags('note'): +type_ = note.getAttr('type') +if type_ is None: +type_ = 'info' + +if type_ not in ('info', 'warn', 'error'): +raise ValueError('invalid note type %s' % type_) + +notes.append(AdHocCommandNote(text=note.getData(), + type=AdHocNoteType(type_))) +return notes + + +def _parse_actions(command): +actions_node = command.getTag('actions') +if actions_node is None: +# If there is no element, +# the user-agent can use a single-stage dialog or view. +# The action "execute" is equivalent to the action "complete". +return [AdHocAction.COMPLETE], AdHocAction.COMPLETE + +actions = [] +for action in actions_node.getChildren(): +name = action.getName() +if name not in ('prev', 'next', 'complete'): +raise ValueError('invalid action name: %s' % name) +actions.append(AdHocAction(name)) + +if not actions: +raise ValueError('actions element without actions') + +default = actions_node.getAttr('execute') +
[Git][gajim/gajim][mainwindow] Reduce icon size
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: a01126c2 by lovetox at 2021-04-30T22:11:12+02:00 Reduce icon size - - - - - 1 changed file: - gajim/gtk/conversation/rows/muc_user_status.py Changes: = gajim/gtk/conversation/rows/muc_user_status.py = @@ -47,7 +47,7 @@ def __init__(self, account, user_contact, is_self): show_icon.set_opacity(0.6) surface = get_show_circle( user_contact.show.value, -AvatarSize.SHOW_CIRCLE, +16, self.get_scale_factor()) show_icon.set_from_surface(surface) self.grid.attach(show_icon, 1, 0, 1, 1) View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/a01126c2b2345d1bd99519d7ca8b55053cc231ef -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/a01126c2b2345d1bd99519d7ca8b55053cc231ef You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][master] Accounts: Use SpinSetting for custom port
Philipp Hörist pushed to branch master at gajim / gajim Commits: a5fc50ca by lovetox at 2021-04-30T17:47:48+02:00 Accounts: Use SpinSetting for custom port Fixes #10541 - - - - - 2 changed files: - gajim/gtk/accounts.py - gajim/gtk/settings.py Changes: = gajim/gtk/accounts.py = @@ -965,9 +965,10 @@ def __init__(self, account, parent): SettingType.ACCOUNT_CONFIG, 'custom_host', bind='account::use_custom_host'), -Setting(SettingKind.ENTRY, _('Port'), +Setting(SettingKind.SPIN, _('Port'), SettingType.ACCOUNT_CONFIG, 'custom_port', -bind='account::use_custom_host'), +bind='account::use_custom_host', +props={'range_': (0, 65535)},), Setting(SettingKind.COMBO, _('Type'), SettingType.ACCOUNT_CONFIG, 'custom_type', = gajim/gtk/settings.py = @@ -497,7 +497,7 @@ def __init__(self, *args, range_): self.spin.set_numeric(True) self.spin.set_update_policy(Gtk.SpinButtonUpdatePolicy.IF_VALID) self.spin.set_value(self.setting_value) -self.spin.set_halign(Gtk.Align.END) +self.spin.set_halign(Gtk.Align.FILL) self.spin.set_valign(Gtk.Align.CENTER) self.spin.connect('notify::value', self.on_value_change) View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/a5fc50ca5d1a8c3f8662dc57e966e5dc0b88a094 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/a5fc50ca5d1a8c3f8662dc57e966e5dc0b88a094 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] 2 commits: Add start of MessageLabel impl
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: 9813f847 by lovetox at 2021-04-30T10:45:52+02:00 Add start of MessageLabel impl - - - - - db76bece by lovetox at 2021-04-30T14:05:20+02:00 Add Links to MessageLabel - - - - - 3 changed files: - gajim/common/styling.py - gajim/gtk/conversation/plain_widget.py - gajim/gtk/util.py Changes: = gajim/common/styling.py = @@ -3,6 +3,8 @@ from dataclasses import dataclass from dataclasses import field +from gi.repository import GLib + PRE = '`' STRONG = '*' STRIKE = '~' @@ -41,23 +43,28 @@ class StyleObject: text: str +class URIMarkup: +def get_markup_string(self): +return f'{self.text}' + + @dataclass -class Uri(StyleObject): +class Uri(StyleObject, URIMarkup): name: str = field(default='uri', init=False) @dataclass -class Address(StyleObject): +class Address(StyleObject, URIMarkup): name: str = field(default='address', init=False) @dataclass -class XMPPAddress(StyleObject): +class XMPPAddress(StyleObject, URIMarkup): name: str = field(default='xmppadr', init=False) @dataclass -class MailAddress(StyleObject): +class MailAddress(StyleObject, URIMarkup): name: str = field(default='mailadr', init=False) @@ -135,7 +142,7 @@ def process(text, nested=False): blocks = _parse_blocks(text, nested) for block in blocks: if isinstance(block, PlainBlock): -offset = block.start +offset = 0 for line in block.text.splitlines(keepends=True): block.spans += _parse_line(line, offset) block.uris += _parse_uris(line, offset) = gajim/gtk/conversation/plain_widget.py = @@ -29,6 +29,7 @@ from gajim.common.i18n import _ from .util import get_cursor +from .util import make_pango_attribute URI_TAGS = ['uri', 'address', 'xmppadr', 'mailadr'] @@ -42,11 +43,38 @@ def __init__(self, account): self._account = account -self._textview = MessageTextview(self._account) -self.add(self._textview) +# self._text_widget = MessageTextview(self._account) +self._text_widget = MessageLabel(self._account) +self.add(self._text_widget) def add_content(self, block): -self._textview.print_text_with_styling(block) +self._text_widget.print_text_with_styling(block) + + +class MessageLabel(Gtk.Label): +def __init__(self, account): +Gtk.Label.__init__(self) +self.set_hexpand(True) +self.set_selectable(True) +self.set_line_wrap(True) +self.set_xalign(0) +self.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR) +self.set_track_visited_links(False) + +self._account = account + +def print_text_with_styling(self, block): +text = GLib.markup_escape_text(block.text.strip()) +for uri in block.uris: +text = text.replace(uri.text, uri.get_markup_string()) + +attr_list = Pango.AttrList() +for span in block.spans: +attr = make_pango_attribute(span.name, span.start, span.end) +attr_list.insert(attr) + +self.set_markup(text) +self.set_attributes(attr_list) class MessageTextview(Gtk.TextView): = gajim/gtk/util.py = @@ -906,3 +906,21 @@ def refresh(self): account_class = app.css_config.get_dynamic_class(self._account) self.get_style_context().add_class(account_class) self.set_tooltip_text(_('Account: %s') % label) + + +def make_pango_attribute(name, start, end): +if name == 'strong': +attr = Pango.attr_weight_new(Pango.Weight.BOLD) +if name == 'strike': +attr = Pango.attr_strikethrough_new(True) +if name == 'emphasis': +attr = Pango.attr_style_new(Pango.Style.ITALIC) +if name == 'pre': +attr = Pango.attr_family_new('monospace') + +else: +ValueError('unknown attribute %s', name) + +attr.start_index = start +attr.end_index = end +return attr View it on GitLab: https://dev.gajim.org/gajim/gajim/-/compare/d74e7bf5d74c4dcfd85a27bb1694b3d16c03b271...db76bece42103e48577ca2cd961c1c9299d9c116 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/compare/d74e7bf5d74c4dcfd85a27bb1694b3d16c03b271...db76bece42103e48577ca2cd961c1c9299d9c116 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] Fix workspace label
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: 650ae662 by lovetox at 2021-04-29T20:47:38+02:00 Fix workspace label - - - - - 1 changed file: - gajim/gtk/chat_page.py Changes: = gajim/gtk/chat_page.py = @@ -123,10 +123,6 @@ def _on_button_release(paned, event): def _on_chat_selected(self, _chat_list_stack, workspace_id, account, jid): self._chat_stack.show_chat(account, jid) self._search_view.set_context(account, jid) - -self._ui.workspace_label.set_text( -app.settings.get_workspace_setting(workspace_id, 'name')) - self.emit('chat-selected', workspace_id, account, jid) def _on_chat_unselected(self, _chat_list_stack): @@ -143,7 +139,11 @@ def _on_search_history(self, _action, _param): def _on_search_hide(self, *args): self._search_revealer.hide() -def _on_chat_list_changed(self, *args): +def _on_chat_list_changed(self, chat_list_stack, *args): +chat_list = chat_list_stack.get_current_chat_list() +name = app.settings.get_workspace_setting(chat_list.workspace_id, + 'name') +self._ui.workspace_label.set_text(name) self._ui.search_entry.set_text('') def process_event(self, event): View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/650ae662a13643feeff2f6a07bace29c6e968390 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/650ae662a13643feeff2f6a07bace29c6e968390 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] Fix Label
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: 83cbe939 by lovetox at 2021-04-29T20:36:15+02:00 Fix Label - - - - - 2 changed files: - gajim/gtk/conversation/rows/info.py - gajim/gtk/conversation/rows/widgets.py Changes: = gajim/gtk/conversation/rows/info.py = @@ -43,6 +43,7 @@ def __init__(self, account, text): self.grid.attach(timestamp_widget, 2, 0, 1, 1) self._label = SimpleLabel() +self._label.set_text(text) self.grid.attach(self._label, 1, 0, 1, 1) self.show_all() = gajim/gtk/conversation/rows/widgets.py = @@ -13,6 +13,7 @@ # along with Gajim. If not, see <http://www.gnu.org/licenses/>. from gi.repository import Gtk +from gi.repository import Pango class SimpleLabel(Gtk.Label): View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/83cbe9394b1035963d51dde717f4b15aa9c03aba -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/83cbe9394b1035963d51dde717f4b15aa9c03aba You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] Add SimpleLabel
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: f0f55aa7 by lovetox at 2021-04-29T14:34:06+02:00 Add SimpleLabel - - - - - 3 changed files: - gajim/gtk/conversation/rows/info.py - gajim/gtk/conversation/rows/muc_join_left.py - + gajim/gtk/conversation/rows/widgets.py Changes: = gajim/gtk/conversation/rows/info.py = @@ -19,10 +19,9 @@ from gi.repository import Gtk from gajim.common.const import AvatarSize -from gajim.common.styling import process +from .widgets import SimpleLabel from .base import BaseRow -from ..message_widget import MessageWidget class InfoMessage(BaseRow): @@ -43,9 +42,7 @@ def __init__(self, account, text): timestamp_widget.set_valign(Gtk.Align.START) self.grid.attach(timestamp_widget, 2, 0, 1, 1) -result = process(text) -message_widget = MessageWidget(account) -message_widget.add_content(result) +self._label = SimpleLabel() -self.grid.attach(message_widget, 1, 0, 1, 1) +self.grid.attach(self._label, 1, 0, 1, 1) self.show_all() = gajim/gtk/conversation/rows/muc_join_left.py = @@ -16,11 +16,11 @@ from datetime import datetime from gi.repository import Gtk -from gi.repository import Pango from gajim.common.i18n import _ from gajim.common.const import AvatarSize +from .widgets import SimpleLabel from .base import BaseRow @@ -33,11 +33,7 @@ def __init__(self, type_, account, nick, reason=None, error=False): self.timestamp = datetime.fromtimestamp(timestamp) self.db_timestamp = timestamp -self._label = Gtk.Label() -self._label.set_selectable(True) -self._label.set_line_wrap(True) -self._label.set_xalign(0) -self._label.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR) +self._label = SimpleLabel() if type_ == 'muc-user-joined': text = self._make_join_message(nick) = gajim/gtk/conversation/rows/widgets.py = @@ -0,0 +1,24 @@ +# This file is part of Gajim. +# +# Gajim is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published +# by the Free Software Foundation; version 3 only. +# +# Gajim is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Gajim. If not, see <http://www.gnu.org/licenses/>. + +from gi.repository import Gtk + + +class SimpleLabel(Gtk.Label): +def __init__(self): +Gtk.Label.__init__(self) +self.set_selectable(True) +self.set_line_wrap(True) +self.set_xalign(0) +self.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR) View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/f0f55aa79e74a194afaf21a1f90e3968af561ff3 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/f0f55aa79e74a194afaf21a1f90e3968af561ff3 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] 254 commits: Flatpak: Update dependencies
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: b8690214 by André Apitzsch at 2021-03-29T12:50:51+02:00 Flatpak: Update dependencies - - - - - 15f73dad by Daniel Brötzmann at 2021-03-30T09:05:46+02:00 Accounts: Add account switch description - - - - - f08f3f0c by lovetox at 2021-04-02T18:51:01+02:00 Fix HtmlTextView test - - - - - 1691af57 by lovetox at 2021-04-09T20:00:19+02:00 Windows: Fix appveyor build - - - - - 2c7f95b5 by Philipp Hörist at 2021-04-21T20:34:11+02:00 Revert "Windows: Add Workaround for #10342" This reverts commit 3334790a15ff4664894f5f19bd60e01760d3f120 - - - - - 5c2b0f53 by lovetox at 2021-04-24T12:23:10+02:00 Remove unused path - - - - - 72f489b4 by lovetox at 2021-04-28T08:15:35+02:00 Windows: Add gssapi dependency Fixes #10540 - - - - - b8a08ebc by lovetox at 2021-04-28T11:40:57+02:00 Start - - - - - d6249a53 by lovetox at 2021-04-28T11:40:57+02:00 Disable CI - - - - - 682ee915 by lovetox at 2021-04-28T11:40:57+02:00 Really disable CI - - - - - f70341f3 by lovetox at 2021-04-28T11:40:58+02:00 Add Workspace settings API - - - - - 3707ff04 by lovetox at 2021-04-28T11:40:58+02:00 Store and Open chats - - - - - ee389c95 by lovetox at 2021-04-28T11:40:58+02:00 Add remove_chat() - - - - - eb9f1880 by lovetox at 2021-04-28T11:40:58+02:00 Account Side Bar - - - - - 30336a77 by lovetox at 2021-04-28T11:40:58+02:00 Add Workspace Side Bar - - - - - b8f82b08 by wurstsalat at 2021-04-28T11:40:58+02:00 ChatList: Add basic elements - - - - - 6134f5dc by wurstsalat at 2021-04-28T11:40:58+02:00 ChatListStack: Add Start Chat - - - - - ea2a293c by wurstsalat at 2021-04-28T11:40:58+02:00 Add basic Sidebar styling - - - - - 918e035e by wurstsalat at 2021-04-28T11:40:58+02:00 Improve styling for Sidebar and ChatList - - - - - a9825932 by lovetox at 2021-04-28T11:40:58+02:00 Store chatlist on remove - - - - - 1e875d11 by lovetox at 2021-04-28T11:40:58+02:00 Add/Remove Workspaces - - - - - a1efb07c by lovetox at 2021-04-28T11:40:58+02:00 Allow to add chats to different workspaces - - - - - 042a00d8 by lovetox at 2021-04-28T11:40:58+02:00 Add transparent backgrounds - - - - - 3084f6b8 by wurstsalat at 2021-04-28T11:40:58+02:00 AccountSideBar: Improve styling - - - - - a3b839d9 by wurstsalat at 2021-04-28T11:40:58+02:00 WorkspaceSidebar: Improve styling - - - - - 270c7cdf by lovetox at 2021-04-28T11:40:58+02:00 Improve left sidebar - - - - - 72174392 by lovetox at 2021-04-28T11:40:58+02:00 css - - - - - ae925e42 by lovetox at 2021-04-28T11:40:58+02:00 Dont fail when account is disabled - - - - - d28dcc38 by lovetox at 2021-04-28T11:40:58+02:00 CSS - - - - - bfe9dc61 by wurstsalat at 2021-04-28T11:40:58+02:00 AvatarSelector: Add Load Image button - - - - - 45d83e93 by Daniel Brötzmann at 2021-04-28T11:40:58+02:00 Workspace: Add Workspace edit dialog - - - - - c9f21788 by wurstsalat at 2021-04-28T11:40:58+02:00 Workspace: Add title and editing functionality - - - - - 6c98e1cc by wurstsalat at 2021-04-28T11:40:58+02:00 MainWindow: Add Paned for chat list and chat controls - - - - - e1ccfe01 by lovetox at 2021-04-28T11:40:58+02:00 Store type for open chats - - - - - fd18e7c8 by lovetox at 2021-04-28T11:40:58+02:00 Store workspace dialog settings - - - - - 5a8820c9 by lovetox at 2021-04-28T11:40:58+02:00 Fix adding new Workspace - - - - - ef42cdb2 by lovetox at 2021-04-28T11:40:58+02:00 Fix some selection bugs - - - - - f9f8d860 by Daniel Brötzmann at 2021-04-28T11:40:58+02:00 ChatListStack: Wrap in ScrolledWindow - - - - - cce5e35e by lovetox at 2021-04-28T11:40:58+02:00 Move scrolled window into gui xml - - - - - 8705d081 by lovetox at 2021-04-28T11:40:58+02:00 sytle chatlist - - - - - 0c257a78 by wurstsalat at 2021-04-28T11:40:58+02:00 ChatList: Styling - - - - - d730788b by wurstsalat at 2021-04-28T11:40:58+02:00 MainWindow: Styling - - - - - 1fb4fb34 by wurstsalat at 2021-04-28T11:40:58+02:00 Accounts: Add basic account page - - - - - 66a69204 by lovetox at 2021-04-28T11:40:58+02:00 Refactor Groupchats - - - - - e70b3f48 by lovetox at 2021-04-28T11:40:58+02:00 Start Chat: Destroy after joining MUC - - - - - fd050a49 by lovetox at 2021-04-28T11:40:58+02:00 Disable Roster - - - - - db9f4191 by lovetox at 2021-04-28T11:40:58+02:00 Make quit work - - - - - ad256b66 by lovetox at 2021-04-28T11:40:58+02:00 Stuff - - - - - bb6d0944 by Daniel Brötzmann at 2021-04-28T11:40:58+02:00 ChatList: Add friendly timestamps - - - - - a0ecc0ba by Daniel Brötzmann at 2021-04-28T11:40:58+02:00 ChatList: Unread counter styling - - - - - 30ed5029 by Daniel Brötzmann at 2021-04-28T11:40:58+02:00 ChatList: Group chat avatars and message lines - - - - - 3ca5acda by Daniel Brötzmann at 2021-04-28T11:40:58+02:00 Paned: Improve ChatList resizing - - - - - 3b032d6b by Daniel Brötzmann at 2021-04-28T11:40:58+02:00 ChatList: Use groupchat name, improve ellipsizing - - - - - 1b8f4a8f by Daniel Brötzmann at 2021-04-28T11:40:58+02:00 ChatList: Add
[Git][gajim/gajim][mainwindow] Simplify init
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: 9c66534e by lovetox at 2021-04-28T10:39:02+02:00 Simplify init - - - - - 2 changed files: - gajim/gtk/chat_list_stack.py - gajim/gtk/chat_page.py Changes: = gajim/gtk/chat_list_stack.py = @@ -49,7 +49,7 @@ class ChatListStack(Gtk.Stack): (str, str, str)), } -def __init__(self, main_window, search_entry): +def __init__(self, search_entry): Gtk.Stack.__init__(self) self.set_hexpand(True) self.set_vexpand(True) @@ -63,7 +63,7 @@ def __init__(self, main_window, search_entry): self.connect('notify::visible-child-name', self._on_visible_child_name) search_entry.connect('search-changed', self._on_search_changed) -main_window.connect('notify::is-active', self._on_window_active) +app.window.connect('notify::is-active', self._on_window_active) self._add_actions() self.show_all() = gajim/gtk/chat_page.py = @@ -59,7 +59,7 @@ def __init__(self): self._search_revealer.add(self._search_view) self._ui.right_grid_overlay.add_overlay(self._search_revealer) -self._chat_list_stack = ChatListStack(app.window, self._ui.search_entry) +self._chat_list_stack = ChatListStack(self._ui.search_entry) self._chat_list_stack.connect('chat-selected', self._on_chat_selected) self._chat_list_stack.connect('chat-unselected', self._on_chat_unselected) View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/9c66534ef6dea56b1dca03264f71bc17b42375e9 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/9c66534ef6dea56b1dca03264f71bc17b42375e9 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] Refactor ChatList
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: d71682a0 by lovetox at 2021-04-28T10:38:06+02:00 Refactor ChatList - - - - - 3 changed files: - gajim/gtk/chat_list_stack.py - gajim/gtk/chat_page.py - gajim/gtk/main.py Changes: = gajim/gtk/chat_list_stack.py = @@ -44,16 +44,17 @@ class ChatListStack(Gtk.Stack): 'chat-unselected': (GObject.SignalFlags.RUN_LAST, None, ()), +'chat-removed': (GObject.SignalFlags.RUN_LAST, + None, + (str, str, str)), } -def __init__(self, main_window, ui, chat_stack): +def __init__(self, main_window, search_entry): Gtk.Stack.__init__(self) self.set_hexpand(True) self.set_vexpand(True) self.set_vhomogeneous(False) -self._ui = ui -self._chat_stack = chat_stack self._chat_lists = {} self._last_visible_child_name = 'default' @@ -61,9 +62,7 @@ def __init__(self, main_window, ui, chat_stack): self.add_named(Gtk.Box(), 'default') self.connect('notify::visible-child-name', self._on_visible_child_name) -self._ui.search_entry.connect( -'search-changed', self._on_search_changed) - +search_entry.connect('search-changed', self._on_search_changed) main_window.connect('notify::is-active', self._on_window_active) self._add_actions() @@ -94,7 +93,6 @@ def _on_visible_child_name(self, _stack, _param): if self._last_visible_child_name == self.get_visible_child_name(): return -self._ui.search_entry.set_text('') if self._last_visible_child_name != 'default': child = self.get_child_by_name(self._last_visible_child_name) child.set_filter_text('') @@ -157,8 +155,6 @@ def show_chat_list(self, workspace_id): if current_workspace_id != 'default': self._chat_lists[current_workspace_id].unselect_all() -self._ui.workspace_label.set_text( -app.settings.get_workspace_setting(workspace_id, 'name')) self.set_visible_child_name(workspace_id) def add_chat(self, workspace_id, account, jid, type_, pinned=False): @@ -204,12 +200,7 @@ def remove_chat(self, workspace_id, account, jid): type_ = chat_list.get_chat_type(account, jid) chat_list.remove_chat(account, jid) self.store_open_chats(workspace_id) - -if not self.contains_chat(account, jid): -self._chat_stack.remove_chat(account, jid) -if type_ == 'groupchat': -client = app.get_client(account) -client.get_module('MUC').leave(jid) +self.emit('chat-removed', account, jid, type_) def _find_chat(self, account, jid): for chat_list in self._chat_lists.values(): = gajim/gtk/chat_page.py = @@ -59,10 +59,13 @@ def __init__(self): self._search_revealer.add(self._search_view) self._ui.right_grid_overlay.add_overlay(self._search_revealer) -self._chat_list_stack = ChatListStack(self, self._ui, self._chat_stack) +self._chat_list_stack = ChatListStack(app.window, self._ui.search_entry) self._chat_list_stack.connect('chat-selected', self._on_chat_selected) self._chat_list_stack.connect('chat-unselected', self._on_chat_unselected) +self._chat_list_stack.connect('chat-removed', self._on_chat_removed) +self._chat_list_stack.connect('notify::visible-child-name', + self._on_chat_list_changed) self._ui.chat_list_scrolled.add(self._chat_list_stack) self._ui.start_chat_button.connect('clicked', @@ -120,6 +123,10 @@ def _on_button_release(paned, event): def _on_chat_selected(self, _chat_list_stack, workspace_id, account, jid): self._chat_stack.show_chat(account, jid) self._search_view.set_context(account, jid) + +self._ui.workspace_label.set_text( +app.settings.get_workspace_setting(workspace_id, 'name')) + self.emit('chat-selected', workspace_id, account, jid) def _on_chat_unselected(self, _chat_list_stack): @@ -136,6 +143,9 @@ def _on_search_history(self, _action, _param): def _on_search_hide(self, *args): self._search_revealer.hide() +def _on_chat_list_changed(self, *args): +self._ui.search_entry.set_text('') + def process_event(self, event): self._chat_stack.process_event(event) self._ch
[Git][gajim/gajim][master] Windows: Add gssapi dependency
Philipp Hörist pushed to branch master at gajim / gajim Commits: 72f489b4 by lovetox at 2021-04-28T08:15:35+02:00 Windows: Add gssapi dependency Fixes #10540 - - - - - 1 changed file: - win/_base.sh Changes: = win/_base.sh = @@ -92,7 +92,8 @@ function install_deps { mingw-w64-"${ARCH}"-python-pyopenssl \ mingw-w64-"${ARCH}"-python-certifi \ mingw-w64-"${ARCH}"-python-six \ -mingw-w64-"${ARCH}"-python-pygments +mingw-w64-"${ARCH}"-python-pygments \ +mingw-w64-"${ARCH}"-python-gssapi build_pip install precis-i18n View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/72f489b4c27440e5a03d0733cd7291f0268bd841 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/72f489b4c27440e5a03d0733cd7291f0268bd841 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] Fix bugs when joining mucs
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: 1c73a02e by lovetox at 2021-04-26T16:34:37+02:00 Fix bugs when joining mucs - - - - - 4 changed files: - gajim/common/modules/contacts.py - gajim/common/modules/muc.py - gajim/groupchat_control.py - gajim/gtk/search_view.py Changes: = gajim/common/modules/contacts.py = @@ -69,6 +69,7 @@ def add_contact(self, jid, groupchat=False): contact = GroupchatContact(self._log, jid, self._account) else: contact = BareContact(self._log, jid, self._account) + self._contacts[jid] = contact return contact @@ -154,6 +155,9 @@ def force_chatstate_update(self): for contact in self._resources.values(): contact.notify('chatstate-update') +def __repr__(self): +return f'{self.jid} ({self._account})' + class BareContact(CommonContact): def __init__(self, logger, jid, account): = gajim/common/modules/muc.py = @@ -214,6 +214,7 @@ def join(self, jid, nick=None, password=None, config=None): disco_info = app.storage.cache.get_last_disco_info(muc_data.jid, max_age=60) if disco_info is None: +self._set_muc_state(muc_data.jid, MUCJoinedState.JOINING) self._con.get_module('Discovery').disco_muc( muc_data.jid, callback=self._on_disco_result) = gajim/groupchat_control.py = @@ -964,7 +964,7 @@ def _set_control_inactive(self): self.update_actions() def rejoin(self): -self._client.get_module('MUC').join(self._muc_data) +self._client.get_module('MUC').join(self.room_jid) # def send_pm(self, nick, message=None): # ctrl = self._start_private_message(nick) @@ -1706,7 +1706,7 @@ def _on_subject_change_clicked(self, _button): def _on_password_set_clicked(self, _button): password = self.xml.password_entry.get_text() self._muc_data.password = password -self._client.get_module('MUC').join(self._muc_data) +self._client.get_module('MUC').join(self.room_jid) self._show_page('groupchat') def _on_password_changed(self, entry, _param): @@ -1763,7 +1763,7 @@ def _on_captcha_cancel_clicked(self, _button=None): self._close_control() def _on_captcha_try_again_clicked(self, _button=None): -self._client.get_module('MUC').join(self._muc_data) +self._client.get_module('MUC').join(self.room_jid) self._show_page('groupchat') def _on_remove_bookmark_button_clicked(self, _button=None): @@ -1771,7 +1771,7 @@ def _on_remove_bookmark_button_clicked(self, _button=None): self._close_control() def _on_retry_join_clicked(self, _button=None): -self._client.get_module('MUC').join(self._muc_data) +self._client.get_module('MUC').join(self.room_jid) self._show_page('groupchat') def _on_page_cancel_clicked(self, _button=None): @@ -1783,5 +1783,5 @@ def _on_page_close_clicked(self, _button=None): def _on_groupchat_state_abort_clicked(self, _button): app.window.lookup_action('disconnect-%s' % self.control_id).activate() -def _on_groupchat_state_join_clicked(self, groupchat_state): -pass +def _on_groupchat_state_join_clicked(self, _groupchat_state): +self._client.get_module('MUC').join(self.room_jid) = gajim/gtk/search_view.py = @@ -197,8 +197,6 @@ def __init__(self, msg, account, jid): self.time = msg.time self._client = app.get_client(account) -self.contact = self._client.get_module('Contacts').get_contact(jid) - self.log_line_id = msg.log_line_id self.timestamp = msg.time self.kind = msg.kind @@ -207,6 +205,9 @@ def __init__(self, msg, account, jid): if msg.kind == KindConstant.GC_MSG: self.type = 'groupchat' +self.contact = self._client.get_module('Contacts').get_contact( +jid, groupchat=self.type == 'groupchat') + self._ui = get_builder('search_view.ui') self.add(self._ui.result_row_grid) View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/1c73a02e55d6ee19fc68ef389c1f959f9655c996 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/1c73a02e55d6ee19fc68ef389c1f959f9655c996 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] Fix Search
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: cd9a20f5 by lovetox at 2021-04-25T20:18:05+02:00 Fix Search - - - - - 1 changed file: - gajim/gtk/search_view.py Changes: = gajim/gtk/search_view.py = @@ -234,7 +234,7 @@ def __init__(self, msg, account, jid): message_widget = MessageWidget(account) self._ui.result_row_grid.attach(message_widget, 1, 1, 2, 1) result = process(msg.message) -message_widget.add_content(result.blocks) +message_widget.add_content(result) self.show_all() View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/cd9a20f506c693f8dba91d644bc3253087e7d1cb -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/cd9a20f506c693f8dba91d644bc3253087e7d1cb You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim] Pushed new tag gajim-1.3.2
Philipp Hörist pushed new tag gajim-1.3.2 at gajim / gajim -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/tree/gajim-1.3.2 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][gajim_1.3] 2 commits: Update ChangeLog
Philipp Hörist pushed to branch gajim_1.3 at gajim / gajim Commits: afca14f1 by lovetox at 2021-04-24T13:27:40+02:00 Update ChangeLog - - - - - 19e371c8 by lovetox at 2021-04-24T13:27:40+02:00 1.3.2 - - - - - 4 changed files: - ChangeLog - appveyor.yml - data/org.gajim.Gajim.appdata.xml.in - gajim/__init__.py Changes: = ChangeLog = @@ -1,3 +1,21 @@ +Gajim 1.3.2 (24 April 2021) + + New + + * Accounts: Add account switch description + + Changes + + * MessageInput: Remove custom placeholder + * MessageInput: Add focus borders + + Bug fixes + + * #10010 Only convert domain name to ASCII + * #10342 UnicodeDecodeError related to avatars + * #10428 Roster: Handle missing avatar_sha + + Gajim 1.3.1 (01 March 2021) New = appveyor.yml = @@ -40,8 +40,8 @@ build_script: bash "git clone C:/projects/gajim C:/msys64/home/appveyor/gajim" bash "C:/msys64/home/appveyor/gajim/win/build.sh $($env:MSYS_ARCH)" -Push-AppveyorArtifact "$($env:BUILDROOT)/Gajim.exe" -FileName "Gajim-1.3.1-$($env:ARCH)-$($env:TIME_STRING).exe" -Push-AppveyorArtifact "$($env:BUILDROOT)/Gajim-Portable.exe" -FileName "Gajim-Portable-1.3.1-$($env:ARCH)-$($env:TIME_STRING).exe" +Push-AppveyorArtifact "$($env:BUILDROOT)/Gajim.exe" -FileName "Gajim-1.3.2-$($env:ARCH)-$($env:TIME_STRING).exe" +Push-AppveyorArtifact "$($env:BUILDROOT)/Gajim-Portable.exe" -FileName "Gajim-Portable-1.3.2-$($env:ARCH)-$($env:TIME_STRING).exe" # on_finish: # - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) = data/org.gajim.Gajim.appdata.xml.in = @@ -72,6 +72,7 @@ intense + = gajim/__init__.py = @@ -2,7 +2,7 @@ import sys from pathlib import Path -__version__ = "1.3.1" +__version__ = "1.3.2" IS_FLATPAK = Path('/app/share/run-as-flatpak').exists() View it on GitLab: https://dev.gajim.org/gajim/gajim/-/compare/e85687a194a11d9e98d66654d4716016bc899098...19e371c835a1c8b976d0149f28f0d2063d455bc5 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/compare/e85687a194a11d9e98d66654d4716016bc899098...19e371c835a1c8b976d0149f28f0d2063d455bc5 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][master] Remove unused path
Philipp Hörist pushed to branch master at gajim / gajim Commits: 5c2b0f53 by lovetox at 2021-04-24T12:23:10+02:00 Remove unused path - - - - - 1 changed file: - gajim/common/configpaths.py Changes: = gajim/common/configpaths.py = @@ -206,7 +206,6 @@ def init(self): paths = [ # Data paths ('LOG_DB', 'logs.db', PathLocation.DATA, PathType.FILE), -('MY_CACERTS', 'cacerts.pem', PathLocation.DATA, PathType.FILE), ('PLUGINS_DOWNLOAD', 'plugins_download', PathLocation.CACHE, PathType.FOLDER), ('PLUGINS_USER', 'plugins', PathLocation.DATA, PathType.FOLDER), ('MY_EMOTS', View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/5c2b0f53bdb38c0f8c47b48cf58f4b8908d65cdf -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/5c2b0f53bdb38c0f8c47b48cf58f4b8908d65cdf You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][gajim_1.3] Revert "Windows: Add Workaround for #10342"
Philipp Hörist pushed to branch gajim_1.3 at gajim / gajim Commits: 1ff73830 by Philipp Hörist at 2021-04-21T20:37:27+02:00 Revert "Windows: Add Workaround for #10342" This reverts commit 3334790a15ff4664894f5f19bd60e01760d3f120 - - - - - 1 changed file: - gajim/common/i18n.py Changes: = gajim/common/i18n.py = @@ -171,9 +171,6 @@ def ngettext(s_sing, s_plural, n, replace_sing=None, replace_plural=None): # find the translation # Use LANGUAGE instead of LANG, LANG sets LC_ALL and thus # doesn't retain other region settings like LC_TIME - -# See https://gitlab.gnome.org/GNOME/pygobject/-/issues/442 -LANG = 'en' os.environ['LANGUAGE'] = LANG except Exception as error: print('Failed to determine default language', file=sys.stderr) View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/1ff73830e4f4601766935bf9bc6c8942361e9112 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/1ff73830e4f4601766935bf9bc6c8942361e9112 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][master] Revert "Windows: Add Workaround for #10342"
Philipp Hörist pushed to branch master at gajim / gajim Commits: 2c7f95b5 by Philipp Hörist at 2021-04-21T20:34:11+02:00 Revert "Windows: Add Workaround for #10342" This reverts commit 3334790a15ff4664894f5f19bd60e01760d3f120 - - - - - 1 changed file: - gajim/common/i18n.py Changes: = gajim/common/i18n.py = @@ -171,9 +171,6 @@ def ngettext(s_sing, s_plural, n, replace_sing=None, replace_plural=None): # find the translation # Use LANGUAGE instead of LANG, LANG sets LC_ALL and thus # doesn't retain other region settings like LC_TIME - -# See https://gitlab.gnome.org/GNOME/pygobject/-/issues/442 -LANG = 'en' os.environ['LANGUAGE'] = LANG except Exception as error: print('Failed to determine default language', file=sys.stderr) View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/2c7f95b5bac18dd8b0bcbfb222fb2272288ad811 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/2c7f95b5bac18dd8b0bcbfb222fb2272288ad811 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] Fix some things
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: 43c93338 by lovetox at 2021-04-18T23:09:16+02:00 Fix some things - - - - - 2 changed files: - gajim/chat_control.py - gajim/gtk/conversation/code_widget.py Changes: = gajim/chat_control.py = @@ -48,7 +48,6 @@ from gajim.common.helpers import open_uri from gajim.common.helpers import geo_provider_from_location from gajim.common.helpers import open_file -from gajim.common.contacts import GC_Contact from gajim.common.const import AvatarSize from gajim.common.const import KindConstant from gajim.common.const import PEPEventType @@ -1191,7 +1190,6 @@ def _on_client_state_changed(self, _client, _signal_name, state): self.msg_textview.set_sensitive(state.is_connected) self.msg_textview.set_editable(state.is_connected) -print(state) self._update_avatar() self.update_toolbar() self.draw_banner() = gajim/gtk/conversation/code_widget.py = @@ -50,7 +50,7 @@ def __init__(self, account): self._textview = CodeTextview() self._scrolled = Gtk.ScrolledWindow() self._scrolled.set_policy(Gtk.PolicyType.AUTOMATIC, - Gtk.PolicyType.AUTOMATIC) + Gtk.PolicyType.NEVER) self._scrolled.set_hexpand(True) self._scrolled.set_vexpand(True) self._scrolled.set_propagate_natural_height(True) View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/43c93338dd2716c01472a468eb368ffaa80d9753 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/43c93338dd2716c01472a468eb368ffaa80d9753 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] Fix Info message
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: d07283da by lovetox at 2021-04-13T23:46:08+02:00 Fix Info message - - - - - 1 changed file: - gajim/gtk/conversation/rows/info.py Changes: = gajim/gtk/conversation/rows/info.py = @@ -19,8 +19,10 @@ from gajim.common.const import AvatarSize from gajim.common.i18n import _ +from gajim.common.styling import process from .base import BaseRow +from ..message_widget import MessageWidget class InfoMessageRow(BaseRow): @@ -56,12 +58,9 @@ def __init__(self, timestamp_widget.set_valign(Gtk.Align.START) self.grid.attach(timestamp_widget, 2, 0, 1, 1) -self.textview.set_justification(Gtk.Justification.CENTER) -self.textview.print_text( -text, -other_text_tags=other_text_tags, -kind=kind, -graphics=graphics) +result = process(text) +message_widget = MessageWidget(account) +message_widget.add_content(result.blocks) -self.grid.attach(self.textview, 1, 0, 1, 1) +self.grid.attach(message_widget, 1, 0, 1, 1) self.show_all() View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/d07283dab924d9c300f94d44dba671c903767050 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/d07283dab924d9c300f94d44dba671c903767050 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][master] Windows: Fix appveyor build
Philipp Hörist pushed to branch master at gajim / gajim Commits: 1691af57 by lovetox at 2021-04-09T20:00:19+02:00 Windows: Fix appveyor build - - - - - 1 changed file: - appveyor.yml Changes: = appveyor.yml = @@ -24,6 +24,7 @@ install: - bash -lc "pacman --needed --noconfirm -Syu" # This is needed because without killing all processes -Su will fail - ps: Get-Process | Where-Object {$_.path -like 'C:\msys64*'} | Stop-Process + - bash -lc "pacman -Sydd --noconfirm filesystem" - bash -lc "pacman --needed --noconfirm -Su" build_script: View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/1691af5715585bf1be96b6c0e77f0ecca7aca828 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/1691af5715585bf1be96b6c0e77f0ecca7aca828 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] Fix readmarker breaking merge
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: a45033ce by lovetox at 2021-04-04T23:51:48+02:00 Fix readmarker breaking merge - - - - - 1 changed file: - gajim/gtk/conversation/view.py Changes: = gajim/gtk/conversation/view.py = @@ -236,6 +236,9 @@ def _find_ancestor(self, message): if row is None: return None +if row.type == 'read_marker': +continue + if row.type != 'chat': return None @@ -254,6 +257,9 @@ def _update_descendants(self, message): if row is None: return +if row.type == 'read_marker': +continue + if row.type != 'chat': return View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/a45033ce8f89390dd7765c279918467d3b848360 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/a45033ce8f89390dd7765c279918467d3b848360 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] show info messages
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: 5a86aeb2 by lovetox at 2021-04-04T23:45:14+02:00 show info messages - - - - - 1 changed file: - gajim/gtk/conversation/rows/info.py Changes: = gajim/gtk/conversation/rows/info.py = @@ -65,3 +65,4 @@ def __init__(self, graphics=graphics) self.grid.attach(self.textview, 1, 0, 1, 1) +self.show_all() View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/5a86aeb247715ebc31c5f44e159a382591e1eed5 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/5a86aeb247715ebc31c5f44e159a382591e1eed5 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] Improve read marker
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: 27cdd4a7 by lovetox at 2021-04-04T23:38:23+02:00 Improve read marker - - - - - 2 changed files: - gajim/chat_control.py - gajim/gtk/conversation/view.py Changes: = gajim/chat_control.py = @@ -559,6 +559,8 @@ def _on_message_received(self, event): correct_id=event.correct_id, additional_data=event.additional_data) +self.conversation_view.set_read_marker(event.properties.id) + def _on_message_error(self, event): self.conversation_view.show_error(event.message_id, event.error) = gajim/gtk/conversation/view.py = @@ -311,6 +311,10 @@ def iter_rows(self): yield row def set_read_marker(self, id_): +if id_ is None: +self._read_marker_row.hide() +return + row = self._get_row_by_message_id(id_) if row is None: return View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/27cdd4a72f7d18dbf71df34cf9f60da86bc7ae94 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/27cdd4a72f7d18dbf71df34cf9f60da86bc7ae94 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] Remove unused imports
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: f354d46a by lovetox at 2021-04-04T23:24:56+02:00 Remove unused imports - - - - - 1 changed file: - gajim/gtk/conversation/view.py Changes: = gajim/gtk/conversation/view.py = @@ -15,8 +15,6 @@ import logging import time -from bisect import bisect_right -from datetime import datetime from datetime import timedelta from gi.repository import GLib @@ -96,7 +94,6 @@ def set_history_complete(self, complete): self._scroll_hint_row.set_history_complete(complete) def _reset_conversation_view(self): -self._last_incoming_timestamp = datetime.fromtimestamp(0) self._row_count = 0 self.clearing = False View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/f354d46a504a5ce53b9b9e419b0a22948b86ab0b -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/f354d46a504a5ce53b9b9e419b0a22948b86ab0b You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] Fix completion state
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: 56f4d5eb by lovetox at 2021-04-04T17:50:50+02:00 Fix completion state - - - - - 4 changed files: - gajim/chat_control_base.py - gajim/gtk/conversation/rows/scroll_hint.py - gajim/gtk/conversation/scrolled.py - gajim/gtk/conversation/view.py Changes: = gajim/chat_control_base.py = @@ -1413,7 +1413,7 @@ def fetch_n_lines_history(self, _scrolled, n_lines): n_lines) if not messages: -self._scrolled_view.set_history_complete() +self._scrolled_view.set_history_complete(True) return for msg in messages: = gajim/gtk/conversation/rows/scroll_hint.py = @@ -29,6 +29,7 @@ def __init__(self, account, history_mode=False): self.type = 'system' self.timestamp = datetime.fromtimestamp(0) +self._history_mode = history_mode self.get_style_context().add_class('conversation-system-row') @@ -36,14 +37,16 @@ def __init__(self, account, history_mode=False): self.label.set_hexpand(True) self.label.get_style_context().add_class( 'conversation-meta') +self.grid.attach(self.label, 0, 1, 1, 1) + +self.set_history_complete(False) -if history_mode: +def set_history_complete(self, complete): +if self._history_mode: self.label.set_text(_('Use the calendar to select a specific date')) -self.grid.attach(self.label, 0, 1, 1, 1) return -self.label.set_text(_('Scroll up to load more chat history…')) -self.grid.attach(self.label, 0, 1, 1, 1) - -def set_history_complete(self): -self.label.set_text(_('There is no more history')) +if complete: +self.label.set_text(_('There is no more history')) +else: +self.label.set_text(_('Scroll up to load more chat history…')) = gajim/gtk/conversation/scrolled.py = @@ -56,13 +56,15 @@ def __init__(self, *args, **kwargs): vadjustment.connect('notify::upper', self._on_adj_upper_changed) vadjustment.connect('notify::value', self._on_adj_value_changed) -@property -def autoscroll(self): +def get_autoscroll(self): return self._autoscroll -def set_history_complete(self): -self._complete = True -self.get_child().get_child().set_history_complete() +def get_view(self): +return self.get_child().get_child() + +def set_history_complete(self, complete): +self._complete = complete +self.get_view().set_history_complete(complete) def _on_adj_upper_changed(self, adj, *args): upper = adj.get_upper() @@ -72,6 +74,7 @@ def _on_adj_upper_changed(self, adj, *args): self._current_upper = upper if self._autoscroll: adj.set_value(adj.get_upper() - adj.get_page_size()) + else: # Workaround # https://gitlab.gnome.org/GNOME/gtk/merge_requests/395 = gajim/gtk/conversation/view.py = @@ -108,8 +108,8 @@ def get_first_message_row(self): return row return None -def set_history_complete(self): -self._scroll_hint_row.set_history_complete() +def set_history_complete(self, complete): +self._scroll_hint_row.set_history_complete(complete) def _reset_conversation_view(self): self._first_date = None @@ -203,10 +203,6 @@ def add_message(self, self._insert_message(message, kind, history) -# Check for maximum message count -# if self.autoscroll and self._row_count > self._max_row_count: -# self._reduce_message_count() - def _get_avatar(self, kind, name): scale = self.get_scale_factor() if self._contact.is_groupchat: @@ -344,7 +340,8 @@ def _is_mergeable(row1, row2): return True return False -def _reduce_message_count(self): +def reduce_message_count(self): +successful = False while self._row_count > self._max_row_count: # We want to keep relevant DateRows when removing rows row1 = self.get_row_at_index(1) @@ -354,6 +351,7 @@ def _reduce_message_count(self): # First two rows are date rows, # it’s safe to remove the fist row self.remove(row1) +successful = True self._timestamps_inserted.remove(row1.timestamp) self._first_date = row2.timestamp.strftime('%a, %d %b %Y')
[Git][gajim/gajim][mainwindow] Fix history mode
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: 2561aac3 by lovetox at 2021-04-04T17:18:28+02:00 Fix history mode - - - - - 1 changed file: - gajim/gtk/conversation/view.py Changes: = gajim/gtk/conversation/view.py = @@ -90,7 +90,8 @@ def __init__(self, account, contact, history_mode=False): self._last_incoming_timestamp = datetime.fromtimestamp(0) # Insert the very first row, containing the scroll hint and load button -self._scroll_hint_row = ScrollHintRow(self._account) +self._scroll_hint_row = ScrollHintRow(self._account, + history_mode=self._history_mode) self.add(self._scroll_hint_row) self._timestamps_inserted.append(datetime.fromtimestamp(0)) View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/2561aac32c0cf6b65a624469dcabaf6418ad2aab -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/2561aac32c0cf6b65a624469dcabaf6418ad2aab You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][master] Fix HtmlTextView test
Philipp Hörist pushed to branch master at gajim / gajim Commits: f08f3f0c by lovetox at 2021-04-02T18:51:01+02:00 Fix HtmlTextView test - - - - - 1 changed file: - test/gtk/htmltextview.py Changes: = test/gtk/htmltextview.py = @@ -7,17 +7,22 @@ from gajim.common import app from gajim.common import configpaths configpaths.init() -from gajim.common.helpers import AdditionalDataDict + from gajim import gui gui.init('gtk') +from gajim.common.helpers import AdditionalDataDict + from gajim.conversation_textview import ConversationTextview from gajim.gui_interface import Interface + +app.settings = MagicMock() app.plugin_manager = MagicMock() app.logger = MagicMock() app.cert_store = MagicMock() +app.storage = MagicMock() app.interface = Interface() View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/f08f3f0c217f9bdf7c86aff47e17a498a555f0d4 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/f08f3f0c217f9bdf7c86aff47e17a498a555f0d4 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] Wrap menu button in eventbox
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: 80bac099 by lovetox at 2021-03-28T21:24:12+02:00 Wrap menu button in eventbox - - - - - 2 changed files: - gajim/gtk/conversation_view.py - gajim/gtk/util.py Changes: = gajim/gtk/conversation_view.py = @@ -41,7 +41,7 @@ from .util import format_fingerprint from .util import scroll_to_end from .util import text_to_color -from .util import get_cursor +from .util import wrap_with_event_box log = logging.getLogger('gajim.gui.conversation_view') @@ -928,12 +928,11 @@ def set_error_tooltip(self, text): self._error_image.set_tooltip_markup(text) +@wrap_with_event_box class MoreMenuButton(Gtk.MenuButton): def __init__(self, row): Gtk.MenuButton.__init__(self) -self.connect_after('realize', self._on_realize) - self.set_valign(Gtk.Align.START) self.set_halign(Gtk.Align.END) self.set_relief(Gtk.ReliefStyle.NONE) @@ -970,6 +969,3 @@ def _create_popover(self, row): popover = Gtk.PopoverMenu() popover.add(menu_box) self.set_popover(popover) - -def _on_realize(self, *args): -self.get_window().set_cursor(get_cursor('pointer')) = gajim/gtk/util.py = @@ -884,3 +884,18 @@ def disconnect_cb(*args): def connect_destroy(sender, *args, **kwargs): return _connect_destroy(sender, sender.connect, *args, **kwargs) + + +def wrap_with_event_box(klass): +@wraps(klass) +def klass_wrapper(*args, **kwargs): +widget = klass(*args, **kwargs) +event_box = Gtk.EventBox() + +def _on_realize(*args): +event_box.get_window().set_cursor(get_cursor('pointer')) + +event_box.connect_after('realize', _on_realize) +event_box.add(widget) +return event_box +return klass_wrapper View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/80bac099bcc5f650e845176bcf1af329b9cc -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/80bac099bcc5f650e845176bcf1af329b9cc You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] 210 commits: Blocking: Adapt to nbxmpp changes
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: 48619565 by lovetox at 2021-03-06T20:57:12+01:00 Blocking: Adapt to nbxmpp changes - - - - - a72b39b1 by André Apitzsch at 2021-03-13T08:06:46+01:00 Only convert domain name to ASCII IDNA is about domain name only, so ignore username, password and port. Fixes #10010. - - - - - 9df1cbcd by Daniel Brötzmann at 2021-03-16T11:15:35+01:00 Profile: Add translation hints for menu entries - - - - - 6f25997b by Daniel Brötzmann at 2021-03-16T11:17:07+01:00 DOAP: Add XEP-0106 - - - - - acc254fe by lovetox at 2021-03-18T21:31:10+01:00 Blocking: Convert JID to string - - - - - e7a02bd1 by lovetox at 2021-03-20T16:03:04+01:00 Roster: Handle missing avatar_sha Fixes #10428 - - - - - d7732dfa by Daniel Brötzmann at 2021-03-25T21:09:05+01:00 MessageInputTextView: Remove custom placeholder - - - - - fadc7596 by Daniel Brötzmann at 2021-03-25T21:09:09+01:00 MessageInputTextView: Add focus borders - - - - - 4e6a0ade by Daniel Brötzmann at 2021-03-26T16:37:07+01:00 MessageInputTextView: Improve style - - - - - b94cf37b by Ruslan Makhmatkhanov at 2021-03-28T14:34:23+02:00 Mention FreeBSD package in README - - - - - 3d01c77a by Ruslan Makhmatkhanov at 2021-03-28T14:37:44+02:00 Replace Windows line endings with Unix ones This change allows package maintainers to remove the dos2unix dependency in Gajim’s FreeBSD port. - - - - - 0c14e46d by lovetox at 2021-03-28T19:19:11+02:00 Start - - - - - a59e42d3 by lovetox at 2021-03-28T19:19:11+02:00 Disable CI - - - - - 266446b7 by lovetox at 2021-03-28T19:19:11+02:00 Really disable CI - - - - - c65b167d by lovetox at 2021-03-28T19:19:11+02:00 Add Workspace settings API - - - - - c33fd895 by lovetox at 2021-03-28T19:19:11+02:00 Store and Open chats - - - - - 71e6b7c6 by lovetox at 2021-03-28T19:19:11+02:00 Add remove_chat() - - - - - 1ce778cf by lovetox at 2021-03-28T19:19:11+02:00 Account Side Bar - - - - - 4a01f80e by lovetox at 2021-03-28T19:19:11+02:00 Add Workspace Side Bar - - - - - 5a48fe41 by wurstsalat at 2021-03-28T19:19:11+02:00 ChatList: Add basic elements - - - - - cb6fdef3 by wurstsalat at 2021-03-28T19:19:11+02:00 ChatListStack: Add Start Chat - - - - - 724fba90 by wurstsalat at 2021-03-28T19:19:11+02:00 Add basic Sidebar styling - - - - - 6a913c98 by wurstsalat at 2021-03-28T19:19:11+02:00 Improve styling for Sidebar and ChatList - - - - - 4379af41 by lovetox at 2021-03-28T19:19:11+02:00 Store chatlist on remove - - - - - d31e1864 by lovetox at 2021-03-28T19:19:11+02:00 Add/Remove Workspaces - - - - - 16566a5c by lovetox at 2021-03-28T19:19:11+02:00 Allow to add chats to different workspaces - - - - - 4eb1b483 by lovetox at 2021-03-28T19:19:11+02:00 Add transparent backgrounds - - - - - 1314bf20 by wurstsalat at 2021-03-28T19:19:11+02:00 AccountSideBar: Improve styling - - - - - 8bf6a475 by wurstsalat at 2021-03-28T19:19:11+02:00 WorkspaceSidebar: Improve styling - - - - - ce9ac984 by lovetox at 2021-03-28T19:19:11+02:00 Improve left sidebar - - - - - aaef8fc4 by lovetox at 2021-03-28T19:19:11+02:00 css - - - - - 0ada1e0d by lovetox at 2021-03-28T19:19:11+02:00 Dont fail when account is disabled - - - - - c0cf7a9d by lovetox at 2021-03-28T19:19:11+02:00 CSS - - - - - 3a7218b1 by wurstsalat at 2021-03-28T19:19:11+02:00 AvatarSelector: Add Load Image button - - - - - 1e2c885f by Daniel Brötzmann at 2021-03-28T19:19:11+02:00 Workspace: Add Workspace edit dialog - - - - - a0fd48dc by wurstsalat at 2021-03-28T19:19:11+02:00 Workspace: Add title and editing functionality - - - - - 4bba349d by wurstsalat at 2021-03-28T19:19:11+02:00 MainWindow: Add Paned for chat list and chat controls - - - - - fdd14817 by lovetox at 2021-03-28T19:19:11+02:00 Store type for open chats - - - - - 4afce1a5 by lovetox at 2021-03-28T19:19:11+02:00 Store workspace dialog settings - - - - - 6df401c7 by lovetox at 2021-03-28T19:19:11+02:00 Fix adding new Workspace - - - - - f55c7f17 by lovetox at 2021-03-28T19:19:11+02:00 Fix some selection bugs - - - - - 5c19b64e by Daniel Brötzmann at 2021-03-28T19:19:11+02:00 ChatListStack: Wrap in ScrolledWindow - - - - - 90e62b9b by lovetox at 2021-03-28T19:19:11+02:00 Move scrolled window into gui xml - - - - - e6305a4a by lovetox at 2021-03-28T19:19:11+02:00 sytle chatlist - - - - - 67c0b560 by wurstsalat at 2021-03-28T19:19:11+02:00 ChatList: Styling - - - - - 4b951f49 by wurstsalat at 2021-03-28T19:19:11+02:00 MainWindow: Styling - - - - - b4ae8d8a by wurstsalat at 2021-03-28T19:19:11+02:00 Accounts: Add basic account page - - - - - e8e8a98c by lovetox at 2021-03-28T19:19:11+02:00 Refactor Groupchats - - - - - 87748ecb by lovetox at 2021-03-28T19:19:11+02:00 Start Chat: Destroy after joining MUC - - - - - cfd85fbf by lovetox at 2021-03-28T19:21:11+02:00 Disable Roster - - - - - a0ed7192 by lovetox at 2021-03-28T19:21:11+02:00 Make quit work - - - - - 5212773f by lovetox at 2021-03-28T19:21:11+02:00 Stuff - - - - - 5103d0ac by Daniel
[Git][gajim/gajim][mainwindow] Better padding
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: f356401b by lovetox at 2021-03-28T18:16:32+02:00 Better padding - - - - - 2 changed files: - gajim/data/style/gajim.css - gajim/gtk/conversation_view.py Changes: = gajim/data/style/gajim.css = @@ -36,8 +36,11 @@ } .conversation-row { -padding: 2px 3px 3px 6px; +padding: 10px 3px 4px 6px; } + +.merged { padding-top: 1px;} + .conversation-row grid textview { background: transparent; } = gajim/gtk/conversation_view.py = @@ -871,11 +871,13 @@ def update_avatar(self, avatar): def set_merged(self, merged): if merged: +self.get_style_context().add_class('merged') self._avatar_surface.set_no_show_all(True) self._avatar_surface.hide() self._meta_box.set_no_show_all(True) self._meta_box.hide() else: +self.get_style_context().remove_class('merged') self._avatar_surface.set_no_show_all(False) self._avatar_surface.show() self._meta_box.set_no_show_all(False) View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/f356401b8b02340d43599058f84d40c3dc6535e3 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/f356401b8b02340d43599058f84d40c3dc6535e3 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/python-nbxmpp][master] 3 commits: Add log_calls decorator
Philipp Hörist pushed to branch master at gajim / python-nbxmpp Commits: 0414d956 by lovetox at 2021-03-21T21:28:12+01:00 Add log_calls decorator - - - - - d2e8aae7 by lovetox at 2021-03-21T21:29:05+01:00 Presence: Fix sending presence - - - - - 98216410 by lovetox at 2021-03-21T21:29:23+01:00 Presence: Use log_calls decorator - - - - - 2 changed files: - nbxmpp/modules/presence.py - nbxmpp/modules/util.py Changes: = nbxmpp/modules/presence.py = @@ -25,6 +25,7 @@ from nbxmpp.util import error_factory from nbxmpp.const import PresenceType from nbxmpp.const import PresenceShow from nbxmpp.modules.base import BaseModule +from nbxmpp.modules.util import log_calls class BasePresence(BaseModule): @@ -93,15 +94,19 @@ class BasePresence(BaseModule): self._log.warning(stanza) return PresenceShow.ONLINE +@log_calls def unsubscribe(self, jid): self.send(jid=jid, typ='unsubscribe') +@log_calls def unsubscribed(self, jid): self.send(jid=jid, typ='unsubscribed') +@log_calls def subscribed(self, jid): self.send(jid=jid, typ='subscribed') +@log_calls def subscribe(self, jid, status=None, nick=None): self.send(jid=jid, typ='subscribe', status=status, nick=nick) @@ -150,4 +155,4 @@ class BasePresence(BaseModule): for node in extend: presence.addChild(node=node) -self._con.send_stanza(presence) +self._client.send_stanza(presence) = nbxmpp/modules/util.py = @@ -15,6 +15,8 @@ # You should have received a copy of the GNU General Public License # along with this program; If not, see <http://www.gnu.org/licenses/>. +import logging +import functools import inspect from urllib.parse import urlparse from urllib.parse import unquote @@ -75,3 +77,12 @@ def make_func_arguments_string(func, self, args, kwargs): arg_string += f'{name}={arg}, ' arg_string = arg_string[:-2] return f'{func.__name__}({arg_string})' + + +def log_calls(func): +@functools.wraps(func) +def func_wrapper(self, *args, **kwargs): +if self._log.isEnabledFor(logging.INFO): +self._log.info(make_func_arguments_string(func, self, args, kwargs)) +return func(self, *args, **kwargs) +return func_wrapper View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/-/compare/0c0d9c205f4167273b850099b7616e4effa01c33...9821641065f63e23eb7b8499de03be8f8a0d73fb -- View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/-/compare/0c0d9c205f4167273b850099b7616e4effa01c33...9821641065f63e23eb7b8499de03be8f8a0d73fb You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][master] Roster: Handle missing avatar_sha
Philipp Hörist pushed to branch master at gajim / gajim Commits: e7a02bd1 by lovetox at 2021-03-20T16:03:04+01:00 Roster: Handle missing avatar_sha Fixes #10428 - - - - - 1 changed file: - gajim/common/modules/roster.py Changes: = gajim/common/modules/roster.py = @@ -58,7 +58,7 @@ def load_roster(self): sub=item['subscription'], ask=item['ask'], groups=item['groups'], -avatar_sha=item['avatar_sha'])) +avatar_sha=item.get('avatar_sha'))) else: self._log.info('Database empty, reset roster version') app.settings.set_account_setting( View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/e7a02bd196709a642f7149d6dabda18dd19973ed -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/e7a02bd196709a642f7149d6dabda18dd19973ed You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] Convert JID
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: df1dd5c2 by lovetox at 2021-03-20T15:31:37+01:00 Convert JID - - - - - 1 changed file: - gajim/gtk/add_contact.py Changes: = gajim/gtk/add_contact.py = @@ -48,7 +48,7 @@ def __init__(self, account=None, contact_jid=None, user_nick=None, group=None): self.adding_jid = False if contact_jid is not None: -contact_jid = app.get_jid_without_resource(contact_jid) +contact_jid = app.get_jid_without_resource(str(contact_jid)) # fill accounts with active accounts accounts = app.get_enabled_accounts_with_labels() View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/df1dd5c2de43cfb808b1bb8cc9803526de2d8e0f -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/df1dd5c2de43cfb808b1bb8cc9803526de2d8e0f You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] Set allow_reply_func
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: 52729d2e by lovetox at 2021-03-20T15:04:27+01:00 Set allow_reply_func - - - - - 4 changed files: - gajim/common/modules/contacts.py - gajim/common/modules/entity_time.py - gajim/common/modules/last_activity.py - gajim/common/modules/software_version.py Changes: = gajim/common/modules/contacts.py = @@ -254,6 +254,10 @@ def subscription(self): def groups(self): return self._get_roster_attr('groups') +@property +def is_subscribed(self): +return self.subscription in ('from', 'both') + @property def is_blocked(self): return self._module('Blocking').is_blocked(self._jid) = gajim/common/modules/entity_time.py = @@ -37,8 +37,20 @@ def set_enabled(self, enabled): self._nbxmpp('EntityTime').disable() return -if app.settings.get_account_setting(self._account, 'send_time_info'): -self._nbxmpp('EntityTime').enable() +if not app.settings.get_account_setting(self._account, +'send_time_info'): +return + +self._nbxmpp('EntityTime').enable() +self._nbxmpp('EntityTime').set_allow_reply_func(self._allow_reply) + +def _allow_reply(self, jid): +item = self._con.get_module('Roster').get_item(jid.bare) +if item is None: +return False + +contact = self._get_contact(jid.bare) +return contact.is_subscribed def get_instance(*args, **kwargs): = gajim/common/modules/last_activity.py = @@ -32,15 +32,24 @@ def __init__(self, con): BaseModule.__init__(self, con) def set_enabled(self, enabled): -if enabled and app.is_installed('IDLE'): -if not app.settings.get_account_setting(self._account, -'send_idle_time'): -return - -self._nbxmpp('LastActivity').set_idle_func( -idle.Monitor.get_idle_sec) -else: +if not enabled or not app.is_installed('IDLE'): self._nbxmpp('LastActivity').disable() +return + +if not app.settings.get_account_setting(self._account, +'send_idle_time'): +return + +self._nbxmpp('LastActivity').set_idle_func(idle.Monitor.get_idle_sec) +self._nbxmpp('LastActivity').set_allow_reply_func(self._allow_reply) + +def _allow_reply(self, jid): +item = self._con.get_module('Roster').get_item(jid.bare) +if item is None: +return False + +contact = self._get_contact(jid.bare) +return contact.is_subscribed def get_instance(*args, **kwargs): = gajim/common/modules/software_version.py = @@ -32,14 +32,24 @@ def __init__(self, con): BaseModule.__init__(self, con) def set_enabled(self, enabled): -if enabled: -if not app.settings.get_account_setting(self._account, -'send_os_info'): -return -self._nbxmpp('SoftwareVersion').set_software_version( -'Gajim', app.version, get_os_info()) -else: +if not enabled: self._nbxmpp('SoftwareVersion').disable() +return + +if not app.settings.get_account_setting(self._account, 'send_os_info'): +return + +self._nbxmpp('SoftwareVersion').set_software_version( +'Gajim', app.version, get_os_info()) +self._nbxmpp('SoftwareVersion').set_allow_reply_func(self._allow_reply) + +def _allow_reply(self, jid): +item = self._con.get_module('Roster').get_item(jid.bare) +if item is None: +return False + +contact = self._get_contact(jid.bare) +return contact.is_subscribed def get_instance(*args, **kwargs): View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/52729d2ed50e5cb9d7f26105870728a5ab7b1ef2 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/52729d2ed50e5cb9d7f26105870728a5ab7b1ef2 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] 2 commits: Remove obsolete methods
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: 359b5f22 by lovetox at 2021-03-20T08:07:22+01:00 Remove obsolete methods - - - - - 029c0d2d by lovetox at 2021-03-20T09:24:33+01:00 Fix PresenceShow comparison - - - - - 2 changed files: - gajim/common/const.py - gajim/gui_interface.py Changes: = gajim/common/const.py = @@ -1132,6 +1132,8 @@ def is_offline(self): return self == PresenceShowExt.OFFLINE def __lt__(self, other): +if isinstance(other, PresenceShowExt): +return False if not isinstance(other, PresenceShow): return NotImplemented return True = gajim/gui_interface.py = @@ -301,53 +301,6 @@ def handle_event_msgnotsent(obj): obj.session.roster_message(obj.jid, msg, obj.time_, obj.conn.name, msg_type='error') -def handle_event_subscribe_presence(self, event): -# ('SUBSCRIBE', account, (jid, text, user_nick)) user_nick is XEP-0172 -account = event.conn.name -event = events.SubscriptionRequestEvent(event.status, event.user_nick) - -self.add_event(account, str(event.jid), event) - -if helpers.allow_showing_notification(account): -event_type = _('Subscription request') -app.notification.popup( -event_type, str(event.jid), account, 'subscription_request', -'gajim-subscription_request', event_type, str(event.jid)) - -def handle_event_subscribed_presence(self, event): -bare_jid = event.jid.bare -resource = event.jid.resource -if bare_jid in app.contacts.get_jid_list(event.account): -contact = app.contacts.get_first_contact_from_jid(event.account, - bare_jid) -contact.resource = resource -self.roster.remove_contact_from_groups(contact.jid, - event.account, - [_('Not in contact list'), -_('Observers')], - update=False) -else: -name = event.jid.localpart -name = name.split('%', 1)[0] -contact = app.contacts.create_contact(jid=bare_jid, - account=event.account, - name=name, - groups=[], - show='online', - status='online', - ask='to', - resource=resource) -app.contacts.add_contact(event.account, contact) -self.roster.add_contact(bare_jid, event.account) - -app.notification.popup( -None, -bare_jid, -event.account, -title=_('Authorization accepted'), -text=_('The contact "%(jid)s" has authorized you' - ' to see their status.') % {'jid': event.jid}) - def show_unsubscribed_dialog(self, account, contact): def _remove(): self.roster.on_req_usub(None, [(contact, account)]) @@ -368,27 +321,6 @@ def _remove(): # FIXME: Per RFC 3921, we can "deny" ack as well, but the GUI does # not show deny -def handle_event_unsubscribed_presence(self, obj): -#('UNSUBSCRIBED', account, jid) -account = obj.conn.name -contact = app.contacts.get_first_contact_from_jid(account, obj.jid) -if not contact: -return - -if helpers.allow_popup_window(account) or not self.systray_enabled: -self.show_unsubscribed_dialog(account, contact) -return - -event = events.UnsubscribedEvent(contact) -self.add_event(account, obj.jid, event) - -if helpers.allow_showing_notification(account): -event_type = _('Unsubscribed') -app.notification.popup( -event_type, obj.jid, account, -'unsubscribed', 'gajim-unsubscribed', -event_type, obj.jid) - def handle_event_gc_decline(self, event): gc_control = self.msg_win_mgr.get_gc_control(str(event.muc), event.account) @@ -1106,12 +1038,6 @@ def create_core_handlers_list(self): 'roster-item-exchange-received': \ [self
[Git][gajim/gajim][mainwindow] show chat stack page on select=True
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: ee41031f by lovetox at 2021-03-19T23:40:51+01:00 show chat stack page on select=True - - - - - 2 changed files: - gajim/gtk/main.py - gajim/gtk/roster.py Changes: = gajim/gtk/main.py = @@ -132,7 +132,7 @@ def _add_actions(self): ('edit-workspace', None, self._edit_workspace), ('remove-workspace', None, self._remove_workspace), ('activate-workspace', 's', self._activate_workspace), -('add-chat', 'as', self._add_chat), +('add-chat', 'a{sv}', self._add_chat), ('add-group-chat', 'as', self._add_group_chat), ('remove-chat', 'as', self._remove_chat), ('toggle-chat-pinned', 'as', self._toggle_chat_pinned), @@ -360,8 +360,7 @@ def add_group_chat(self, account, jid, select=False): select=select) def _add_chat(self, _action, param): -account, jid, type_ = param.unpack() -self.add_chat(account, jid, type_) +self.add_chat(**param.unpack()) def add_chat(self, account, jid, type_, select=False): workspace_id = self._workspace_side_bar.get_active_workspace() @@ -389,6 +388,7 @@ def add_chat_for_workspace(self, if self.chat_exists(account, jid): if select: self._chat_list_stack.select_chat(account, jid) +self.show_chats() return if type_ == 'groupchat': @@ -407,6 +407,7 @@ def add_chat_for_workspace(self, if self._startup_finished: if select: self._chat_list_stack.select_chat(account, jid) +self.show_chats() self._chat_list_stack.store_open_chats(workspace_id) def _toggle_chat_pinned(self, _action, param): = gajim/gtk/roster.py = @@ -276,7 +276,6 @@ def _on_roster_row_activated(self, _treeview, path, _column): jid = self._store[iter_][Column.JID_OR_GROUP] app.window.add_chat(self._account, jid, 'contact', select=True) -app.window.show_chats() def _on_roster_button_press_event(self, treeview, event): if event.button not in (2, 3): @@ -300,7 +299,6 @@ def _on_roster_button_press_event(self, treeview, event): if event.button == 2: # middle click app.window.add_chat(self._account, jid, 'contact', select=True) -app.window.show_chats() @staticmethod def _on_focus_out(treeview, _param): View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/ee41031f2c1c708995de8b187e48e90900643258 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/ee41031f2c1c708995de8b187e48e90900643258 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] Get correct path
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: c10f473f by lovetox at 2021-03-19T14:10:29+01:00 Get correct path - - - - - 1 changed file: - gajim/gtk/roster.py Changes: = gajim/gtk/roster.py = @@ -268,6 +268,7 @@ def _on_remove_contact(self, _action, param): app.window.remove_contact(self._account, param.get_string()) def _on_roster_row_activated(self, _treeview, path, _column): +path = self._modelfilter.convert_path_to_child_path(path) iter_ = self._store.get_iter(path) if self._store.iter_parent(iter_) is None: # This is a group row @@ -286,6 +287,7 @@ def _on_roster_button_press_event(self, treeview, event): return path, _, _, _ = pos +path = self._modelfilter.convert_path_to_child_path(path) iter_ = self._store.get_iter(path) if self._store.iter_parent(iter_) is None: # Group row View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/c10f473ff146c5027476795376a51a7fd4a33f58 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/c10f473ff146c5027476795376a51a7fd4a33f58 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][master] Blocking: Convert JID to string
Philipp Hörist pushed to branch master at gajim / gajim Commits: acc254fe by lovetox at 2021-03-18T21:31:10+01:00 Blocking: Convert JID to string - - - - - 1 changed file: - gajim/gtk/blocking.py Changes: = gajim/gtk/blocking.py = @@ -76,7 +76,7 @@ def _on_blocking_list_received(self, task): self._prev_blocked_jids = set(blocking_list) self._ui.blocking_store.clear() for item in blocking_list: -self._ui.blocking_store.append((item,)) +self._ui.blocking_store.append((str(item),)) self._set_grid_state(True) self._disable_spinner() View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/acc254fe367cee2f15f1bcea55e9fce9faa327e5 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/acc254fe367cee2f15f1bcea55e9fce9faa327e5 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] Simplify code
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: bc3e394a by lovetox at 2021-03-17T22:16:24+01:00 Simplify code - - - - - 1 changed file: - gajim/gtk/groupchat_invite.py Changes: = gajim/gtk/groupchat_invite.py = @@ -80,17 +80,16 @@ def _add_contacts(self): for account, _label in self._accounts: self.new_contact_rows[account] = None client = app.get_client(account) -for jid, _data in client.get_module('Roster').iter(): -contact = client.get_module('Contacts').get_contact(jid) +for contact in client.get_module('Roster').iter_contacts(): # Exclude group chats if contact.is_groupchat: continue # Exclude our own jids -if jid in our_jids: +if contact.jid in our_jids: continue -row = ContactRow(account, contact, jid, +row = ContactRow(account, contact, contact.jid, contact.name, show_account) self._ui.contacts_listbox.add(row) View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/bc3e394a0921ab05faf7f909724945f1d7252b69 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/bc3e394a0921ab05faf7f909724945f1d7252b69 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] fix rename group
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: 82c1db1f by lovetox at 2021-03-15T22:49:23+01:00 fix rename group - - - - - 1 changed file: - gajim/common/modules/roster.py Changes: = gajim/common/modules/roster.py = @@ -169,9 +169,6 @@ def remove_group(self, group): self.set_groups(item.jid, new_groups) def rename_group(self, group, new_group): -if new_group in self._groups: -return - items = self._get_items_with_group(group) for item in items: new_groups = item.groups - set([group]) View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/82c1db1f0a49006f45403c6cb4d23445349e8862 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/82c1db1f0a49006f45403c6cb4d23445349e8862 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] more group functions
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: ba15754f by lovetox at 2021-03-15T22:00:41+01:00 more group functions - - - - - 1 changed file: - gajim/common/modules/roster.py Changes: = gajim/common/modules/roster.py = @@ -159,6 +159,25 @@ def get_groups(self): self._groups = groups return set(groups) +def _get_items_with_group(self, group): +return filter(lambda item: group in item.groups, self._roster.values()) + +def remove_group(self, group): +items = self._get_items_with_group(group) +for item in items: +new_groups = item.groups - set([group]) +self.set_groups(item.jid, new_groups) + +def rename_group(self, group, new_group): +if new_group in self._groups: +return + +items = self._get_items_with_group(group) +for item in items: +new_groups = item.groups - set([group]) +new_groups.add(new_group) +self.set_groups(item.jid, new_groups) + def change_group(self, jid, old_group, new_group): item = self.get_item(jid) groups = set(item.groups) View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/ba15754f2656e50ad3c5bbf5d0b5f0ea619b2a07 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/ba15754f2656e50ad3c5bbf5d0b5f0ea619b2a07 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] add get_groups()
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: 8293075c by lovetox at 2021-03-15T20:37:40+01:00 add get_groups() - - - - - 1 changed file: - gajim/common/modules/roster.py Changes: = gajim/common/modules/roster.py = @@ -45,6 +45,9 @@ def __init__(self, con): self._roster = {} +# Groups cache for performance +self._groups = None + def load_roster(self): self._log.info('Load from database') roster = app.storage.cache.load_roster(self._account) @@ -105,6 +108,8 @@ def _on_request_roster(self, task): def _set_roster_from_data(self, items): self._roster.clear() +self._groups = None + for item in items: self._log.info(item) self._con.get_module('Contacts').add_contact(item.jid) @@ -121,6 +126,7 @@ def _process_roster_push(self, _con, _stanza, properties): else: self._roster[item.jid] = item +self._groups = None self._store_roster() self._log.info('New version: %s', properties.roster.version) @@ -143,6 +149,16 @@ def set_groups(self, jid, groups): item = self.get_item(jid) self._nbxmpp('Roster').set_item(jid, item.name, groups) +def get_groups(self): +if self._groups is not None: +return set(self._groups) + +groups = set() +for item in self._roster.values(): +groups.update(item.groups) +self._groups = groups +return set(groups) + def change_group(self, jid, old_group, new_group): item = self.get_item(jid) groups = set(item.groups) View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/8293075c2ab4d6dc804797a216b3bbb2b63c1649 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/8293075c2ab4d6dc804797a216b3bbb2b63c1649 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/python-nbxmpp][master] RosterItem: Copy attributes
Philipp Hörist pushed to branch master at gajim / python-nbxmpp Commits: 73944b1c by lovetox at 2021-03-13T22:06:52+01:00 RosterItem: Copy attributes - - - - - 1 changed file: - nbxmpp/structs.py Changes: = nbxmpp/structs.py = @@ -147,7 +147,7 @@ class RosterItem: @classmethod def from_node(cls, node): -attrs = node.getAttrs() +attrs = node.getAttrs(copy=True) jid = attrs.get('jid') if jid is None: raise Exception('jid attribute missing') View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/-/commit/73944b1c4392fbd06fd946c3f3450d8153ae5dea -- View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/-/commit/73944b1c4392fbd06fd946c3f3450d8153ae5dea You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] Fix GC menu
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: 8c9a34b8 by lovetox at 2021-03-13T13:34:33+01:00 Fix GC menu - - - - - 2 changed files: - gajim/gtk/groupchat_roster.py - gajim/gui_menu_builder.py Changes: = gajim/gtk/groupchat_roster.py = @@ -308,10 +308,8 @@ def _on_roster_button_press_event(self, treeview, event): self.emit('row-activated', nick) def _show_contact_menu(self, nick): -self_contact = app.contacts.get_gc_contact( -self._account, self.room_jid, self._control.nick) -contact = app.contacts.get_gc_contact( -self._account, self.room_jid, nick) +self_contact = self._group_chat_contact.get_resource(self._control.nick) +contact = self._group_chat_contact.get_resource(nick) menu = get_groupchat_roster_menu(self._account, self._control_id, self_contact, = gajim/gui_menu_builder.py = @@ -883,15 +883,6 @@ def get_groupchat_roster_menu(account, control_id, self_contact, contact): item.set_detailed_action_name(action) menu.append(item) -item = Gtk.MenuItem(label=_('Invite')) -if contact.jid is not None: -build_invite_submenu(item, - ((contact, account),), - show_bookmarked=True) -else: -item.set_sensitive(False) -menu.append(item) - item = Gtk.MenuItem(label=_('Execute Command…')) action = 'win.execute-command-%s::%s' % (control_id, contact.name) item.set_detailed_action_name(action) View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/8c9a34b8200de417463d44292fd7f33848191937 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/8c9a34b8200de417463d44292fd7f33848191937 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][master] Only convert domain name to ASCII
Philipp Hörist pushed to branch master at gajim / gajim Commits: a72b39b1 by André Apitzsch at 2021-03-13T08:06:46+01:00 Only convert domain name to ASCII IDNA is about domain name only, so ignore username, password and port. Fixes #10010. - - - - - 1 changed file: - gajim/common/helpers.py Changes: = gajim/common/helpers.py = @@ -140,11 +140,11 @@ def puny_encode_url(url): _url = '//' + _url try: o = urllib.parse.urlparse(_url) -p_loc = idn_to_ascii(o.netloc) +p_loc = idn_to_ascii(o.hostname) except Exception: log.debug('urlparse failed: %s', url) return False -return url.replace(o.netloc, p_loc) +return url.replace(o.hostname, p_loc) def parse_resource(resource): """ View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/a72b39b1ec120945f187c6cd660a84dfc2a282ac -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/a72b39b1ec120945f187c6cd660a84dfc2a282ac You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] Remove module mock
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: 135e8063 by lovetox at 2021-03-10T20:39:41+01:00 Remove module mock - - - - - 1 changed file: - gajim/common/modules/__init__.py Changes: = gajim/common/modules/__init__.py = @@ -20,7 +20,6 @@ import sys import logging from importlib import import_module -from unittest.mock import MagicMock from gajim.common.types import ConnectionT @@ -91,28 +90,6 @@ ] # type: List[str] -class ModuleMock: -def __init__(self, name: str) -> None: -self._name = name - -# HTTPUpload, .. -self.available = False - -# Blocking -self.blocked = [] # type: List[Any] - -# Delimiter -self.delimiter = '::' - -# Bookmarks -self.bookmarks = {} # type: Dict[Any, Any] - -# Various Modules -self.supported = False - -def __getattr__(self, key: str) -> MagicMock: -return MagicMock() - def register_modules(con: ConnectionT, *args: Any, **kwargs: Any) -> None: if con in _modules: @@ -153,10 +130,7 @@ def send_stored_publish(account: str) -> None: def get(account: str, name: str) -> Any: -try: -return _modules[account][name] -except KeyError: -return ModuleMock(name) +return _modules[account][name] def _load_module(name: str, con: ConnectionT, *args: Any, **kwargs: Any) -> Any: View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/135e80639665628f44066632bb1a057a7d10738c -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/135e80639665628f44066632bb1a057a7d10738c You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] Fix add to contact list
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: 7151f8f5 by lovetox at 2021-03-10T20:38:06+01:00 Fix add to contact list - - - - - 1 changed file: - gajim/gui_menu_builder.py Changes: = gajim/gui_menu_builder.py = @@ -821,7 +821,7 @@ def get_roster_menu(account, jid): def get_chat_list_row_menu(workspace_id, account, jid, pinned): client = app.get_client(account) -contact = client.get_module('Contact').get_contact(jid) +contact = client.get_module('Contacts').get_contact(jid) toggle_label = _('Unpin Chat') if pinned else _('Pin Chat') @@ -830,7 +830,8 @@ def get_chat_list_row_menu(workspace_id, account, jid, pinned): (_('Move Chat'), []), ] -if not contact.is_in_roster(): + +if not contact.is_in_roster: menu_items.append(('add-to-roster', _('Add to contact list'))) menu = Gio.Menu() View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/7151f8f58745cf3bb4102fc2af1ad5605a2288d5 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/7151f8f58745cf3bb4102fc2af1ad5605a2288d5 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] Raise cache size
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: 74fc36e6 by lovetox at 2021-03-07T21:35:02+01:00 Raise cache size - - - - - 1 changed file: - gajim/gtk/avatar.py Changes: = gajim/gtk/avatar.py = @@ -148,7 +148,7 @@ def add_status_to_avatar(surface, show): return context.get_target() -@lru_cache(maxsize=8) +@lru_cache(maxsize=128) def get_show_circle(show, size, scale): size = size * scale center = size / 2 View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/74fc36e644c0dfe4988a14c31ed201d3d9445898 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/74fc36e644c0dfe4988a14c31ed201d3d9445898 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] Add get_show_circle()
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: c168a5d3 by lovetox at 2021-03-07T21:20:56+01:00 Add get_show_circle() - - - - - 1 changed file: - gajim/gtk/avatar.py Changes: = gajim/gtk/avatar.py = @@ -148,6 +148,36 @@ def add_status_to_avatar(surface, show): return context.get_target() +@lru_cache(maxsize=8) +def get_show_circle(show, size, scale): +size = size * scale +center = size / 2 +radius = size / 3 + +surface = cairo.ImageSurface(cairo.Format.ARGB32, size, size) +context = cairo.Context(surface) + +css_color = get_css_show_class(show.value) +color = convert_rgb_string_to_float( +app.css_config.get_value(css_color, StyleAttr.COLOR)) + +context.set_source_rgb(*color) +context.set_operator(cairo.Operator.OVER) +context.arc(center, center, radius, 0, 2 * pi) +context.fill() + +if show.value == 'dnd': +line_length = radius * 0.65 +context.move_to(center - line_length, center) +context.line_to(center + line_length, center) + +context.set_source_rgb(255, 255, 255) +context.set_line_width(size / 10) +context.stroke() + +return context.get_target() + + def square(surface, size): width = surface.get_width() height = surface.get_height() View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/c168a5d3b3b42a1cf0fa96170e0fc62fc4ff5a95 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/c168a5d3b3b42a1cf0fa96170e0fc62fc4ff5a95 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] Add methods for accessing resources
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: a6d61265 by lovetox at 2021-03-07T20:31:42+01:00 Add methods for accessing resources - - - - - 1 changed file: - gajim/common/modules/contacts.py Changes: = gajim/common/modules/contacts.py = @@ -154,9 +154,22 @@ def get_resource(self, resource): contact = self.add_resource(resource) return contact +def get_resources(self): +resources = [] +for contact in self._resources.values(): +if contact.show != PresenceShowExt.OFFLINE: +resources.append(contact) +return resources + +def iter_resources(self): +for contact in self._resources.values(): +if contact.show != PresenceShowExt.OFFLINE: +yield contact + @property def is_available(self): -return any([contact.is_available for contact in self._resources.values()]) +return any([contact.is_available for contact +in self._resources.values()]) @property def show(self): View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/a6d61265c77b887db157c154c23d75fcab832c78 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/a6d61265c77b887db157c154c23d75fcab832c78 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] Save workspace order
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: 71ce5b66 by lovetox at 2021-03-07T13:11:50+01:00 Save workspace order - - - - - 2 changed files: - gajim/gtk/main.py - gajim/gtk/workspace_side_bar.py Changes: = gajim/gtk/main.py = @@ -303,6 +303,8 @@ def add_workspace(self, workspace_id): self._chat_list_stack.add_chat_list(workspace_id) self._workspace_side_bar.activate_workspace(workspace_id) self._chat_list_stack.show_chat_list(workspace_id) +if self._startup_finished: +self._workspace_side_bar.store_workspace_order() def _edit_workspace(self, _action, _param): workspace_id = self.get_active_workspace() = gajim/gtk/workspace_side_bar.py = @@ -104,6 +104,7 @@ def _on_drag_data_received(self, _widget, _drag_context, _x_coord, pos = len(self.get_children()) - 1 self.insert(row, pos) +self.store_workspace_order() app.window.activate_workspace(workspace_id) def _on_drag_leave(self, _widget, _drag_context, _time): @@ -147,6 +148,11 @@ def add_workspace(self, workspace_id): # Insert row before AddWorkspace row self.insert(row, len(self.get_children()) - 1) +def store_workspace_order(self): +order = [row.workspace_id for row in self.get_children()] +order.remove('add') +app.settings.set_app_setting('workspace_order', order) + def remove_workspace(self, workspace_id): if len(self._workspaces) == 1: return False View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/71ce5b66e19326941d652db18f1227aec7b06722 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/71ce5b66e19326941d652db18f1227aec7b06722 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] 2 commits: Fix leaving muc
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: 5270bad4 by lovetox at 2021-03-07T11:12:15+01:00 Fix leaving muc - - - - - 30b27cdd by lovetox at 2021-03-07T11:21:37+01:00 Add more leak checks - - - - - 7 changed files: - gajim/chat_control.py - gajim/common/helpers.py - gajim/common/modules/chatstates.py - gajim/groupchat_control.py - gajim/gtk/chat_list_stack.py - gajim/gui_interface.py - gajim/gui_menu_builder.py Changes: = gajim/chat_control.py = @@ -1106,6 +1106,7 @@ def shutdown(self): # Remove contact instance if contact has been removed super(ChatControl, self).shutdown() +app.check_finalize(self) def minimizable(self): return False = gajim/common/helpers.py = @@ -1299,14 +1299,14 @@ def disconnect(self, object_): for qualifier, handlers in qualifiers.items(): for handler in list(handlers): func = handler() -if func is None or func.__self__ == object_: +if func is None or func.__self__ is object_: self._callbacks[signal_name][qualifier].remove(handler) def connect(self, signal_name, func, qualifiers=None): -if inspect.ismethod(func): -weak_func = weakref.WeakMethod(func) -elif inspect.isfunction(func): -weak_func = weakref.ref(func) +if not inspect.ismethod(func): +raise ValueError('Only bound methods allowed') + +weak_func = weakref.WeakMethod(func) self._callbacks[signal_name][qualifiers].append(weak_func) = gajim/common/modules/chatstates.py = @@ -120,8 +120,9 @@ def _presence_received(self, self._log.info('Reset chatstate for %s', jid) contact = self._get_contact(jid) -if contact is None: +if contact.is_groupchat: return + contact.notify('chatstate-update') def _process_chatstate(self, _con, _stanza, properties): = gajim/groupchat_control.py = @@ -307,7 +307,6 @@ def add_actions(self): ('rename-groupchat-', None, self._on_rename_groupchat), ('change-subject-', None, self._on_change_subject), ('change-nickname-', None, self._on_change_nick), -('disconnect-', None, self._on_disconnect), ('destroy-', None, self._on_destroy_room), ('configure-', None, self._on_configure_room), ('request-voice-', None, self._on_request_voice), @@ -476,9 +475,6 @@ def _on_muc_disco_update(self, _event): self.draw_banner_text() # Actions -def _on_disconnect(self, _action, _param): -self.leave() - def _on_information(self, _action, _param): self._muc_info_box.set_from_disco_info(self.disco_info) if self._subject_data is not None: @@ -1006,12 +1002,6 @@ def got_disconnected(self): self.update_actions() -def leave(self, reason=None): -self.got_disconnected() -self._close_control(reason=reason) -app.connections[self.account].get_module('MUC').leave( -self.room_jid, reason=reason) - def rejoin(self): app.connections[self.account].get_module('MUC').join(self._muc_data) @@ -1390,6 +1380,8 @@ def shutdown(self, reason=None): app.settings.disconnect_signals(self) self.contact.disconnect(self) +client = app.get_client(self.account) +client.get_module('MUC').get_manager().disconnect(self) # PluginSystem: removing GUI extension points connected with # GrouphatControl instance object app.plugin_manager.remove_gui_extension_point( @@ -1411,6 +1403,7 @@ def shutdown(self, reason=None): self.remove_actions() super(GroupchatControl, self).shutdown() +app.check_finalize(self) def safe_shutdown(self): # whether to ask for confirmation before closing muc = gajim/gtk/chat_list_stack.py = @@ -100,7 +100,7 @@ def add_chat_list(self, workspace_id): def remove_chat_list(self, workspace_id): chat_list = self._chat_lists[workspace_id] self.remove(chat_list) -for account, jid, _ in chat_list.get_open_chats(): +for account, jid, _, _ in chat_list.get_open_chats(): self.remove_chat(workspace_id, account, jid) self._chat_lists.pop(workspace_id) = gajim/gui_interface.py ===
[Git][gajim/gajim][mainwindow] Remove unused import
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: 7e2351d2 by lovetox at 2021-03-06T21:31:28+01:00 Remove unused import - - - - - 1 changed file: - gajim/gtk/roster.py Changes: = gajim/gtk/roster.py = @@ -14,7 +14,6 @@ from gajim.common.const import AvatarSize from gajim.common.const import StyleAttr from gajim.common.const import PresenceShowExt -from gajim.common.helpers import jid_is_blocked from gajim.common.helpers import event_filter from gajim.common.i18n import _ View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/7e2351d29fa2cb8809f0713973efac039ccd09c5 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/7e2351d29fa2cb8809f0713973efac039ccd09c5 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] 2 commits: Roster: Refactor
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: f23b0d57 by lovetox at 2021-03-06T21:06:35+01:00 Roster: Refactor - - - - - ccaa24f9 by lovetox at 2021-03-06T21:30:45+01:00 Roster: Fix reset - - - - - 1 changed file: - gajim/gtk/roster.py Changes: = gajim/gtk/roster.py = @@ -85,6 +85,7 @@ def __init__(self, account): self.register_events([ ('account-connected', ged.CORE, self._on_account_state), ('account-disconnected', ged.CORE, self._on_account_state), +('roster-received', ged.CORE, self._on_roster_received), ('theme-update', ged.GUI2, self._on_theme_update), ('roster-push', ged.GUI2, self._on_roster_push), ]) @@ -308,20 +309,24 @@ def _get_contact_visible(self, contact): return True -def set_model(self): +def _set_model(self): self._roster.set_model(self._modelfilter) -def redraw(self): +def _unset_model(self): self._roster.set_model(None) -self._roster.set_model(self._modelfilter) + +def redraw(self): +self._unset_model() +self._set_model() self._roster.expand_all() -def _reset(self): -self._roster.set_model(None) -self.enable_sort(False) +def _reset_roster(self): +self._unset_model() +self._enable_sort(False) +self._clear() self._initial_draw() -def enable_sort(self, enable): +def _enable_sort(self, enable): column = Gtk.TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID if enable: column = Column.TEXT @@ -333,8 +338,8 @@ def _initial_draw(self): self._connect_contact_signals(contact) self._add_or_update_contact(contact) -self.enable_sort(True) -self.set_model() +self._enable_sort(True) +self._set_model() self._roster.expand_all() def _connect_contact_signals(self, contact): @@ -347,7 +352,7 @@ def _on_contact_update(self, contact, _signal_name): @event_filter(['account']) def _on_roster_received(self, _event): -self._reset() +self._reset_roster() @event_filter(['account']) def _on_roster_push(self, event): @@ -560,9 +565,9 @@ def _tree_compare_iters(self, model, iter1, iter2, _user_data): group2 = model[iter2][Column.JID_OR_GROUP] return -1 if group1 < group2 else 1 -def clear(self): -self._contact_refs = {} -self._group_refs = {} +def _clear(self): +self._contact_refs.clear() +self._group_refs.clear() self._store.clear() def process_event(self, event): @@ -571,9 +576,9 @@ def process_event(self, event): def _on_destroy(self, _roster): self._remove_actions() -self._contact_refs = {} -self._group_refs = {} -self._roster.set_model(None) +self._contact_refs.clear() +self._group_refs.clear() +self._unset_model() self._roster = None self._store.clear() self._store.reset_default_sort_func() View it on GitLab: https://dev.gajim.org/gajim/gajim/-/compare/e4dc7e3e729e69228427f1f1630d545ad264a8e9...ccaa24f9329077527ea3ad0a78ca0302c9fcb89f -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/compare/e4dc7e3e729e69228427f1f1630d545ad264a8e9...ccaa24f9329077527ea3ad0a78ca0302c9fcb89f You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][master] Blocking: Adapt to nbxmpp changes
Philipp Hörist pushed to branch master at gajim / gajim Commits: 48619565 by lovetox at 2021-03-06T20:57:12+01:00 Blocking: Adapt to nbxmpp changes - - - - - 1 changed file: - gajim/common/modules/blocking.py Changes: = gajim/common/modules/blocking.py = @@ -69,7 +69,7 @@ def get_blocking_list(self): raise_if_error(blocking_list) -self.blocked = blocking_list +self.blocked = list(blocking_list) app.nec.push_incoming_event(NetworkEvent('blocking', conn=self._con, changed=self.blocked)) View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/486195654b47fe0b555d433a84389603d4c6e8cf -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/486195654b47fe0b555d433a84389603d4c6e8cf You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/python-nbxmpp][master] Blocking: Use JID and sets everywhere
Philipp Hörist pushed to branch master at gajim / python-nbxmpp Commits: e3839b91 by lovetox at 2021-03-06T20:54:23+01:00 Blocking: Use JID and sets everywhere - - - - - 2 changed files: - nbxmpp/modules/blocking.py - nbxmpp/structs.py Changes: = nbxmpp/modules/blocking.py = @@ -52,9 +52,15 @@ class Blocking(BaseModule): if blocklist is None: raise MalformedStanzaError('blocklist node missing', result) -blocked = [] +blocked = set() for item in blocklist.getTags('item'): -blocked.append(item.getAttr('jid')) +try: +jid = JID.from_string(item.getAttr('jid')) +except Exception: +self._log.info('Invalid JID: %s', item.getAttr('jid')) +continue + +blocked.add(jid) self._log.info('Received blocking list: %s', blocked) yield blocked @@ -121,9 +127,9 @@ def _make_unblock_request(jids): def _parse_push(node): items = node.getTags('item') if not items: -return BlockingPush(block=[], unblock=[], unblock_all=True) +return BlockingPush(block=set(), unblock=set(), unblock_all=True) -jids = [] +jids = set() for item in items: jid = item.getAttr('jid') if not jid: @@ -134,10 +140,10 @@ def _parse_push(node): except Exception: continue -jids.append(jid) +jids.add(jid) -block, unblock = [], [] +block, unblock = set(), set() if node.getName() == 'block': block = jids else: = nbxmpp/structs.py = @@ -156,7 +156,7 @@ class RosterItem: attrs['jid'] = jid groups = {group.getData() for group in node.getTags('group')} -attrs['groups'] = set(groups) +attrs['groups'] = groups return cls(**attrs) View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/-/commit/e3839b9174c97480e7808fb030589e3ad4fd8331 -- View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/-/commit/e3839b9174c97480e7808fb030589e3ad4fd8331 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] Roster: Fix removing contact
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: 3213b5c8 by lovetox at 2021-03-06T16:30:30+01:00 Roster: Fix removing contact - - - - - 3 changed files: - gajim/common/modules/roster.py - gajim/gtk/main.py - gajim/gtk/roster.py Changes: = gajim/common/modules/roster.py = @@ -116,7 +116,10 @@ def _process_roster_push(self, _con, _stanza, properties): self._log.info('Push received') item = properties.roster.item -self._roster[item.jid] = item +if item.subscription == 'remove': +self._roster.pop(item.jid) +else: +self._roster[item.jid] = item self._store_roster() = gajim/gtk/main.py = @@ -522,18 +522,18 @@ def _block_contact(report=None): modal=False).show() def remove_contact(self, account, jid): +client = app.get_client(account) + def _remove_contact(): self.remove_chat(account, jid) -roster = self._account_pages[account].get_roster() -roster.remove_contact(jid) +client.get_module('Roster').delete_item(jid) -client = app.get_client(account) contact = client.get_module('Contacts').get_contact(jid) sec_text = _('You are about to remove %(name)s (%(jid)s) from ' 'your contact list.\n') % { 'name': contact.name, 'jid': jid} -# TODO: ConfirmationCheckDialog for subscription decision? + ConfirmationDialog( _('Remove Contact'), _('Remove contact from contact list'), = gajim/gtk/roster.py = @@ -26,10 +26,7 @@ log = logging.getLogger('gajim.gui.roster') -HANDLED_EVENTS = [ -'presence-received', -] - +HANDLED_EVENTS = [] DEFAULT_GROUP = _('Contacts') @@ -354,7 +351,11 @@ def _on_roster_received(self, _event): @event_filter(['account']) def _on_roster_push(self, event): contact = self._get_contact(event.item.jid) -self._add_or_update_contact(contact) + +if event.item.subscription == 'remove': +self._remove_contact(contact) +else: +self._add_or_update_contact(contact) def _get_current_groups(self, jid): groups = set() @@ -560,18 +561,10 @@ def clear(self): self._group_refs = {} self._store.clear() -def _on_presence_received(self, _event): -pass - def process_event(self, event): if event.name not in HANDLED_EVENTS: return -if event.name == 'presence-received': -self._on_presence_received(event) -else: -log.warning('Unhandled Event: %s', event.name) - def _on_destroy(self, _roster): self._remove_actions() self._contact_refs = {} View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/3213b5c8ae2e5d1368e4af5d77c7b3b5002ab0c1 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/3213b5c8ae2e5d1368e4af5d77c7b3b5002ab0c1 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/python-nbxmpp][master] Roster: Use a set for groups
Philipp Hörist pushed to branch master at gajim / python-nbxmpp Commits: 03bbb2fa by lovetox at 2021-03-06T16:04:59+01:00 Roster: Use a set for groups - - - - - 1 changed file: - nbxmpp/structs.py Changes: = nbxmpp/structs.py = @@ -15,7 +15,7 @@ # You should have received a copy of the GNU General Public License # along with this program; If not, see <http://www.gnu.org/licenses/>. -from typing import List +from typing import Set import time import random @@ -143,7 +143,7 @@ class RosterItem: name: str = None ask: str = None subscription: str = None -groups: List[str] = field(default_factory=list) +groups: Set[str] = field(default_factory=set) @classmethod def from_node(cls, node): @@ -156,7 +156,7 @@ class RosterItem: attrs['jid'] = jid groups = {group.getData() for group in node.getTags('group')} -attrs['groups'] = list(groups) +attrs['groups'] = set(groups) return cls(**attrs) View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/-/commit/03bbb2fafe30652c905beb4903e4893f6488ab0a -- View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/-/commit/03bbb2fafe30652c905beb4903e4893f6488ab0a You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] 3 commits: JSONEncoder/Decoder: handle set
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: 3bbd1a93 by lovetox at 2021-03-06T15:28:18+01:00 JSONEncoder/Decoder: handle set - - - - - 7172b2a4 by lovetox at 2021-03-06T15:28:29+01:00 Roster: add group methods - - - - - 400fe65b by lovetox at 2021-03-06T15:32:41+01:00 Make dnd functional - - - - - 3 changed files: - gajim/common/modules/roster.py - gajim/common/storage/base.py - gajim/gtk/roster.py Changes: = gajim/common/modules/roster.py = @@ -134,6 +134,19 @@ def _process_roster_push(self, _con, _stanza, properties): def get_item(self, jid): return self._roster.get(jid) +def set_groups(self, jid, groups): +if groups is not None: +groups = set(groups) +item = self.get_item(jid) +self._nbxmpp('Roster').set_item(jid, item.name, groups) + +def change_group(self, jid, old_group, new_group): +item = self.get_item(jid) +groups = set(item.groups) +groups.discard(old_group) +groups.add(new_group) +self._nbxmpp('Roster').set_item(jid, item.name, groups) + def iter(self): for jid, data in self._roster.items(): yield jid, data = gajim/common/storage/base.py = @@ -80,6 +80,9 @@ def _adapt_disco_info(disco_info): class Encoder(json.JSONEncoder): def default(self, obj): +if isinstance(obj, set): +return list(obj) + if isinstance(obj, JID): return {'__type': 'JID', 'value': str(obj)} @@ -99,6 +102,7 @@ def json_decoder(dct): return JID.from_string(dct['value']) if type_ == 'RosterItem': dct.pop('__type') +dct['groups'] = set(dct['groups']) return RosterItem(**dct) return dct = gajim/gtk/roster.py = @@ -193,12 +193,9 @@ def _on_drag_data_received(self, treeview, _drag_context, x_coord, return source_group = model[iter_source_parent][Column.JID_OR_GROUP] -delimiter = self._client.get_module('Delimiter').delimiter -source_groups = source_group.split(delimiter) -if DEFAULT_GROUP in source_groups: -source_groups = [] + jid = model[iter_source][Column.JID_OR_GROUP] -name = model[iter_source][Column.TEXT] +# name = model[iter_source][Column.TEXT] # Destination: the row receiving the drop iter_dest = model.get_iter(path_dest) @@ -209,25 +206,16 @@ def _on_drag_data_received(self, treeview, _drag_context, x_coord, else: dest_group = model[iter_dest_parent][Column.JID_OR_GROUP] -dest_groups = dest_group.split(delimiter) -if DEFAULT_GROUP in dest_groups: -# Dropped into DEFAULT_GROUP, remove all groups -print('remoing all groups') -# self._client.get_module('Roster').update_contact(jid, name, []) +if source_group == dest_group: return -print('source groups') -print(source_groups) -print('dest groups') -print(dest_groups) -if source_groups == dest_groups: -# Dropped into source group +if DEFAULT_GROUP == dest_group: +self._client.get_module('Roster').set_groups(jid, None) return -groups = list(set(dest_groups) - set(source_groups)) -print('final groups') -print(groups) -print('setting new groups') -# self._client.get_module('Roster').update_contact(jid, name, groups) + +self._client.get_module('Roster').change_group(jid, + source_group, + dest_group) def _on_show_offline(self, action, param): action.set_state(param) View it on GitLab: https://dev.gajim.org/gajim/gajim/-/compare/ef13942716966b5f0f08fffef1b06fa557059901...400fe65b6decf49612d6668e29a9df7c5a67adc4 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/compare/ef13942716966b5f0f08fffef1b06fa557059901...400fe65b6decf49612d6668e29a9df7c5a67adc4 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] Add high performance option for big rosters
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: ef139427 by lovetox at 2021-03-06T14:26:29+01:00 Add high performance option for big rosters - - - - - 2 changed files: - gajim/common/modules/roster.py - gajim/gtk/roster.py Changes: = gajim/common/modules/roster.py = @@ -62,6 +62,9 @@ def load_roster(self): def _store_roster(self): app.storage.cache.store_roster(self._account, self._roster) +def get_size(self): +return len(self._roster) + def request_roster(self): version = app.settings.get_account_setting(self._account, 'roster_version') = gajim/gtk/roster.py = @@ -92,8 +92,14 @@ def __init__(self, account): ('roster-push', ged.GUI2, self._on_roster_push), ]) +roster_size = self._client.get_module('Roster').get_size() +self._high_performance = roster_size > 1000 + self._modelfilter = self._store.filter_new() -self._modelfilter.set_visible_column(Column.VISIBLE) +if self._high_performance: +self._modelfilter.set_visible_func(self._visible_func) +else: +self._modelfilter.set_visible_column(Column.VISIBLE) self._filter_enabled = False self._filter_string = '' @@ -292,10 +298,19 @@ def _show_contact_menu(self, jid, treeview, event): popover.popup() def set_search_string(self, text): -self._filter_string = text +self._filter_string = text.lower() self._filter_enabled = bool(text) self._refilter() +def _visible_func(self, model, iter_, *_data): +if not self._filter_enabled: +return True + +if not model[iter_][Column.IS_CONTACT]: +return True + +return self._filter_string in model[iter_][Column.TEXT].lower() + def _get_contact_visible(self, contact): if self._filter_enabled: return self._filter_string in contact.name.lower() @@ -452,6 +467,11 @@ def _draw_group(self, group_name): self._store[group_iter][Column.TEXT] = group_name def _refilter(self): +if self._high_performance: +self._modelfilter.refilter() +self._roster.expand_all() +return + for group in self._store: group_is_visible = False for child in group.iterchildren(): View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/ef13942716966b5f0f08fffef1b06fa557059901 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/ef13942716966b5f0f08fffef1b06fa557059901 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] Dont show empty groups when filtering
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: cb37eae0 by lovetox at 2021-03-06T13:36:12+01:00 Dont show empty groups when filtering - - - - - 1 changed file: - gajim/gtk/roster.py Changes: = gajim/gtk/roster.py = @@ -80,7 +80,7 @@ def __init__(self, account): ]) self._modelfilter = self._store.filter_new() -self._modelfilter.set_visible_func(self._visible_func) +self._modelfilter.set_visible_column(Column.VISIBLE) self._filter_enabled = False self._filter_string = '' @@ -145,7 +145,7 @@ def _on_theme_update(self, _event): def _on_show_offline(self, action, param): action.set_state(param) app.settings.set('showoffline', param.get_boolean()) -self._draw_contacts() +self._refilter() def _on_contact_info(self, _action, param): app.window.contact_info(self._account, param.get_string()) @@ -213,7 +213,7 @@ def _show_contact_menu(self, jid, treeview, event): def set_search_string(self, text): self._filter_string = text self._filter_enabled = bool(text) -self._draw_contacts() +self._refilter() def _get_contact_visible(self, contact): if self._filter_enabled: @@ -227,20 +227,6 @@ def _get_contact_visible(self, contact): return True -def _visible_func(self, model, iter_, _data): -visible = model[iter_][Column.VISIBLE] -is_contact = model[iter_][Column.IS_CONTACT] -name = model[iter_][Column.TEXT] - -if not is_contact: -# Always show groups -return True - -if self._filter_enabled: -return self._filter_string in name.lower() - -return visible - def set_model(self): self._roster.set_model(self._modelfilter) @@ -261,10 +247,6 @@ def enable_sort(self, enable): self._store.set_sort_column_id(column, Gtk.SortType.ASCENDING) -def invalidate_sort(self): -self.enable_sort(False) -self.enable_sort(True) - def _initial_draw(self): for contact in self._client.get_module('Roster').iter_contacts(): contact.connect('presence-update', self._on_presence_update) @@ -387,11 +369,18 @@ def _draw_group(self, group_name): group_name += f' ({group_users}/{total_users})' self._store[group_iter][Column.TEXT] = group_name -self._store[group_iter][Column.VISIBLE] = True -def _draw_contacts(self): -for jid in self._contact_refs: -self._draw_contact(self._get_contact(jid)) +def _refilter(self): +for group in self._store: +group_is_visible = False +for child in group.iterchildren(): +contact = self._get_contact(child[Column.JID_OR_GROUP]) +is_visible = self._get_contact_visible(contact) +child[Column.VISIBLE] = is_visible +if is_visible: +group_is_visible = True + +group[Column.VISIBLE] = group_is_visible self._roster.expand_all() def _draw_contact(self, contact): @@ -406,8 +395,6 @@ def _draw_contact_row(self, ref, contact): if jid_is_blocked(self._account, contact.jid): name = f'{name}' self._store[iter_][Column.TEXT] = name -visible = self._get_contact_visible(contact) -self._store[iter_][Column.VISIBLE] = visible surface = contact.get_avatar( AvatarSize.ROSTER, self.get_scale_factor()) View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/cb37eae0dd53c7166a7097b35432f7ecaa8669fd -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/cb37eae0dd53c7166a7097b35432f7ecaa8669fd You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/python-nbxmpp][master] Roster: Handle roster pushes
Philipp Hörist pushed to branch master at gajim / python-nbxmpp Commits: 225267ed by lovetox at 2021-03-05T23:08:10+01:00 Roster: Handle roster pushes - - - - - 2 changed files: - nbxmpp/modules/roster.py - nbxmpp/structs.py Changes: = nbxmpp/modules/roster.py = @@ -22,7 +22,8 @@ from nbxmpp.protocol import Iq from nbxmpp.protocol import NodeProcessed from nbxmpp.structs import RosterData from nbxmpp.structs import RosterItem -# from nbxmpp.structs import StanzaHandler +from nbxmpp.structs import RosterPush +from nbxmpp.structs import StanzaHandler from nbxmpp.errors import StanzaError from nbxmpp.errors import MalformedStanzaError from nbxmpp.task import iq_request_task @@ -36,11 +37,11 @@ class Roster(BaseModule): self._client = client self.handlers = [ -# StanzaHandler(name='iq', -# callback=self._process_roster_push, -# typ='set', -# priority=15, -# ns=Namespace.ROSTER), +StanzaHandler(name='iq', + callback=self._process_roster_push, + typ='set', + priority=15, + ns=Namespace.ROSTER), ] @iq_request_task @@ -67,21 +68,28 @@ class Roster(BaseModule): raise MalformedStanzaError('query node missing', response) yield RosterData(None, version) -yield self._parse_push(response, ver_support) +pushed_items, version = self._parse_push(response, ver_support) +yield RosterData(pushed_items, version) def _process_roster_push(self, _client, stanza, properties): from_ = stanza.getFrom() if from_ is not None: -if not self._con.get_bound_jid().bare == from_: +if not self._client.get_bound_jid().bare == from_: self._log.warning('Malicious Roster Push from %s', from_) raise NodeProcessed ver_support = self._client.features.has_roster_version() -properties.roster = self._parse_push(stanza, ver_support) +pushed_items, version = self._parse_push(stanza, ver_support) +if len(pushed_items) != 1: +self._log.warning('Roster push contains more than one item') +self._log.warning(stanza) +raise NodeProcessed + +item = pushed_items[0] +properties.roster = RosterPush(item, version) self._log.info('Roster Push, version: %s', properties.roster.version) -for item in properties.roster.items: -self._log.info(item) +self._log.info(item) self._ack_roster_push(stanza) @@ -90,7 +98,7 @@ class Roster(BaseModule): to=stanza.getFrom(), frm=stanza.getTo(), attrs={'id': stanza.getID()}) -self._con.send_stanza(iq) +self._client.send_stanza(iq) @iq_request_task def delete_item(self, jid): @@ -126,8 +134,7 @@ class Roster(BaseModule): pushed_items.append(roster_item) -return RosterData(pushed_items, version) - +return pushed_items, version def _make_delete(jid): = nbxmpp/structs.py = @@ -134,6 +134,7 @@ MAMPreferencesData = namedtuple('MAMPreferencesData', 'default always never') LastActivityData = namedtuple('LastActivityData', 'seconds status') RosterData = namedtuple('RosterData', 'items version') +RosterPush = namedtuple('RosterPush', 'item version') @dataclass View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/-/commit/225267edef7026d3217dd196682c541c8643499e -- View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/-/commit/225267edef7026d3217dd196682c541c8643499e You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] Fix Filter
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: c8099697 by lovetox at 2021-03-03T21:37:01+01:00 Fix Filter - - - - - 2 changed files: - gajim/gtk/chat_list.py - gajim/gtk/chat_list_stack.py Changes: = gajim/gtk/chat_list.py = @@ -66,7 +66,8 @@ def _update_timer(self): def _filter_func(self, row): if not self._current_filter_text: return True -return self._current_filter_text in row.jid +text = self._current_filter_text.lower() +return text in row.contact.name.lower() @staticmethod def _header_func(row, before): @@ -256,11 +257,11 @@ def __init__(self, workspace_id, account, jid, type_, pinned): self.conversations_label = ConversationsHeader() self.pinned_label = PinnedHeader() -self._contact = app.get_client(account).get_module('Contacts').get_contact(jid) -self._contact.connect('presence-update', self._on_presence_update) -self._contact.connect('chatstate-update', self._on_chatstate_update) -self._contact.connect('nickname-update', self._on_nickname_update) -self._contact.connect('avatar-update', self._on_avatar_update) +self.contact = app.get_client(account).get_module('Contacts').get_contact(jid) +self.contact.connect('presence-update', self._on_presence_update) +self.contact.connect('chatstate-update', self._on_chatstate_update) +self.contact.connect('nickname-update', self._on_nickname_update) +self.contact.connect('avatar-update', self._on_avatar_update) self._timestamp = None self._unread_count = 0 @@ -367,17 +368,17 @@ def _on_avatar_update(self, _contact, _signal_name): def update_avatar(self): scale = self.get_scale_factor() -surface = self._contact.get_avatar(AvatarSize.ROSTER, scale) +surface = self.contact.get_avatar(AvatarSize.ROSTER, scale) self._ui.avatar_image.set_from_surface(surface) def update_name(self): if self.type == 'pm': client = app.get_client(self.account) muc_name = get_groupchat_name(client, self.jid) -self._ui.name_label.set_text(f'{self._contact.name} ({muc_name})') +self._ui.name_label.set_text(f'{self.contact.name} ({muc_name})') return -self._ui.name_label.set_text(self._contact.name) +self._ui.name_label.set_text(self.contact.name) def _on_chatstate_update(self, contact, _signal_name): if contact.chatstate is None: = gajim/gtk/chat_list_stack.py = @@ -38,9 +38,12 @@ def __init__(self, main_window, ui, chat_stack): self._chat_stack = chat_stack self._chat_lists = {} +self._last_visible_child_name = 'default' + self.add_named(Gtk.Box(), 'default') self.show_all() +self.connect('notify::visible-child-name', self._on_visible_child_name) self._ui.search_entry.connect( 'search-changed', self._on_search_changed) @@ -53,6 +56,16 @@ def _on_window_active(self, window, _param): if chat is not None: chat.reset_unread() +def _on_visible_child_name(self, _stack, _param): +if self._last_visible_child_name == self.get_visible_child_name(): +return + +self._ui.search_entry.set_text('') +if self._last_visible_child_name != 'default': +child = self.get_child_by_name(self._last_visible_child_name) +child.set_filter_text('') +self._last_visible_child_name = self.get_visible_child_name() + def get_chatlist(self, workspace_id): return self._chat_lists[workspace_id] View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/c8099697ccd8136f738cf5136757b70605e889d7 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/c8099697ccd8136f738cf5136757b70605e889d7 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] Groupchat: Restore got_disconnected()
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: d48d1772 by lovetox at 2021-03-02T20:28:51+01:00 Groupchat: Restore got_disconnected() - - - - - 1 changed file: - gajim/groupchat_control.py Changes: = gajim/groupchat_control.py = @@ -992,6 +992,20 @@ def is_connected(self) -> bool: def is_connected(self, value: bool) -> None: app.gc_connected[self.account][self.room_jid] = value +def got_disconnected(self): +self.xml.formattings_button.set_sensitive(False) + +self.roster.enable_sort(False) +self.roster.clear() + +self.is_connected = False +ChatControlBase.got_disconnected(self) + +con = app.connections[self.account] +con.get_module('Chatstate').remove_delay_timeout(self.contact) + +self.update_actions() + def leave(self, reason=None): self.got_disconnected() self._close_control(reason=reason) View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/d48d1772464ba6a1bea791bd0d8903a8c965c3da -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/d48d1772464ba6a1bea791bd0d8903a8c965c3da You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] Refactor Avatar clipping
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: 002da9f8 by lovetox at 2021-03-02T18:09:21+01:00 Refactor Avatar clipping - - - - - 1 changed file: - gajim/gtk/avatar.py Changes: = gajim/gtk/avatar.py = @@ -86,10 +86,7 @@ def generate_avatar(letters, color, size, scale): def generate_default_avatar(letter, color_string, size, scale, style='circle'): color = text_to_color(color_string) surface = generate_avatar(letter, color, size, scale) -if style == 'circle': -surface = clip_circle(surface) -elif style == 'round-corners': -surface = round_corners(surface) +surface = clip(surface, style) surface.set_device_scale(scale, scale) return surface @@ -97,10 +94,7 @@ def generate_default_avatar(letter, color_string, size, scale, style='circle'): @lru_cache(maxsize=None) def make_workspace_avatar(letter, color, size, scale, style='round-corners'): surface = generate_avatar(letter, color, size, scale) -if style == 'circle': -surface = clip_circle(surface) -elif style == 'round-corners': -surface = round_corners(surface) +surface = clip(surface, style) surface.set_device_scale(scale, scale) return surface @@ -178,6 +172,14 @@ def square(surface, size): return context.get_target() +def clip(surface, mode): +if mode == 'circle': +return clip_circle(surface) +if mode == 'round-corners': +return round_corners(surface) +raise ValueError('clip mode unknown: %s' % mode) + + def clip_circle(surface): new_surface = cairo.ImageSurface(cairo.Format.ARGB32, surface.get_width(), @@ -228,23 +230,6 @@ def round_corners(surface): return context.get_target() -def get_avatar_from_pixbuf(pixbuf, scale, show=None): -size = max(pixbuf.get_width(), pixbuf.get_height()) -size *= scale -surface = Gdk.cairo_surface_create_from_pixbuf(pixbuf, scale) -if surface is None: -return None -surface = square(surface, size) -if surface is None: -return None -surface = clip_circle(surface) -if surface is None: -return None -if show is not None: -return add_status_to_avatar(surface, show) -return surface - - class AvatarStorage(metaclass=Singleton): def __init__(self): self._cache = defaultdict(dict) @@ -276,7 +261,7 @@ def get_surface(self, if surface is not None: return surface -surface = self._get_avatar_from_storage(contact, size, scale) +surface = self._get_avatar_from_storage(contact, size, scale, style) if surface is not None: if show is not None: surface = add_status_to_avatar(surface, show) @@ -294,7 +279,13 @@ def get_surface(self, self._cache[jid][(size, scale, show)] = surface return surface -def get_muc_surface(self, account, jid, size, scale, default=False): +def get_muc_surface(self, +account, +jid, +size, +scale, +default=False, +style='circle'): if not default: surface = self._cache[jid].get((size, scale)) if surface is not None: @@ -305,14 +296,14 @@ def get_muc_surface(self, account, jid, size, scale, default=False): surface = self.surface_from_filename(avatar_sha, size, scale) if surface is None: return None -surface = clip_circle(surface) +surface = clip(surface, style) self._cache[jid][(size, scale)] = surface return surface con = app.connections[account] name = get_groupchat_name(con, jid) letter = self._generate_letter(name) -surface = generate_default_avatar(letter, str(jid), size, scale) +surface = generate_default_avatar(letter, str(jid), size, scale, style) self._cache[jid][(size, scale)] = surface return surface @@ -414,7 +405,7 @@ def _load_surface_from_storage(self, filename, size, scale): surface = Gdk.cairo_surface_create_from_pixbuf(pixbuf, scale) return square(surface, size) -def _get_avatar_from_storage(self, contact, size, scale): +def _get_avatar_from_storage(self, contact, size, scale, style): avatar_sha = contact.avatar_sha if avatar_sha is None: return None @@ -422,7 +413,7 @@ def _get_avatar_from_storage(self, contact, size, scale): surface = self._load_surface_from_storage(avatar_sha, size, scale) if surface is None: return None -return
[Git][gajim/gajim][mainwindow] Fix status selector
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: c2accf28 by lovetox at 2021-03-01T23:46:17+01:00 Fix status selector - - - - - 4 changed files: - gajim/common/client.py - gajim/gtk/account_side_bar.py - gajim/gtk/status_selector.py - gajim/gui_interface.py Changes: = gajim/common/client.py = @@ -28,6 +28,7 @@ from gajim.common import helpers from gajim.common import modules from gajim.common.const import ClientState +from gajim.common.structs import UNKNOWN_PRESENCE from gajim.common.helpers import get_custom_host from gajim.common.helpers import get_user_proxy from gajim.common.helpers import warn_about_plain_connection @@ -294,6 +295,9 @@ def _after_disconnect(self): self._destroy_client = False self._create_client() +jid = self.get_own_jid() +contact = self.get_module('Contacts').get_contact(jid) +contact.update_presence(UNKNOWN_PRESENCE) app.nec.push_incoming_event(NetworkEvent('account-disconnected', account=self._account)) = gajim/gtk/account_side_bar.py = @@ -83,9 +83,13 @@ def __init__(self, account): client = app.get_client(self._account) self._contact = client.get_module('Contacts').get_contact(jid) self._contact.connect('avatar-update', self._on_avatar_update) +self._contact.connect('presence-update', self._on_presence_update) self._update_image() +def _on_presence_update(self, _contact, _signal_name): +self._update_image() + def _on_avatar_update(self, _contact, _signal_name): self._update_image() = gajim/gtk/status_selector.py = @@ -16,6 +16,7 @@ from gi.repository import Pango from gajim.common import app +from gajim.common import ged from gajim.common.helpers import get_uf_show from gajim.common.helpers import get_global_show from gajim.common.helpers import statuses_unified @@ -30,7 +31,6 @@ def __init__(self, compact=False): self.set_direction(Gtk.ArrowType.UP) self._compact = compact self._create_popover() -self.set_no_show_all(True) self._current_show_icon = Gtk.Image() self._current_show_icon.set_from_icon_name( @@ -47,6 +47,8 @@ def __init__(self, compact=False): box.show_all() self.add(box) +app.ged.register_event_handler('our-show', ged.POSTGUI, self.update) + def _create_popover(self): popover_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL) popover_box.get_style_context().add_class('margin-3') @@ -106,13 +108,14 @@ def _on_change_status(self, button): if new_status == 'change_status_message': new_status = None app.interface.change_status(status=new_status) +self.update() -def update(self): -if not app.connections: -self.hide() -return +def update(self, *args, **kwargs): +# if not app.connections: +# self.hide() +# return -self.show() +# self.show() show = get_global_show() uf_show = get_uf_show(show) self._current_show_icon.set_from_icon_name( = gajim/gui_interface.py = @@ -1653,11 +1653,8 @@ def autoconnect(self): status_message = helpers.from_one_line(status_message) app.connections[account].change_status(status, status_message) -# self.roster.send_status(account, status, status_message) - -def change_status(self, status=None): -# status=None means we want to change the message only +def change_status(self, status): ask = ask_for_status_message(status) if status is None: @@ -1672,12 +1669,9 @@ def change_status(self, status=None): 'sync_with_global_status'): continue -message = app.get_client(account).status_message -self.roster.send_status(account, status, message) - -def change_account_status(self, account, status=None): -# status=None means we want to change the message only +self._change_status(account, status) +def change_account_status(self, account, status): ask = ask_for_status_message(status) client = app.get_client(account) @@ -1688,8 +1682,26 @@ def change_account_status(self, account, status=None): open_window('StatusChange', status=status, account=account) return +self._change_status(account, status) + +@staticmethod
[Git][gajim/gajim][mainwindow] Remove unused events and methods
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: ba5d7ead by lovetox at 2021-03-01T22:36:54+01:00 Remove unused events and methods - - - - - 3 changed files: - gajim/chat_control.py - gajim/gtk/main.py - gajim/gui_interface.py Changes: = gajim/chat_control.py = @@ -619,12 +619,6 @@ def _on_receipt_received(self, event): def _on_displayed_received(self, event): self.conv_textview.show_displayed(event.marker_id) -def _on_zeroconf_error(self, event): -self.add_status_message(event.message) - -def _on_update_roster_avatar(self, _event): -self._update_avatar() - def _nec_ping(self, event): if self.contact != event.contact: return = gajim/gtk/main.py = @@ -84,10 +84,6 @@ def __init__(self): self.register_events([ ('presence-received', ged.GUI1, self._on_event), -('mood-received', ged.GUI1, self._on_event), -('activity-received', ged.GUI1, self._on_event), -('tune-received', ged.GUI1, self._on_event), -('location-received', ged.GUI1, self._on_event), ('caps-update', ged.GUI1, self._on_event), ('message-sent', ged.OUT_POSTCORE, self._on_event), ('message-received', ged.CORE, self._on_event), @@ -96,31 +92,10 @@ def __init__(self): ('receipt-received', ged.GUI1, self._on_event), ('displayed-received', ged.GUI1, self._on_event), ('message-error', ged.GUI1, self._on_event), -('update-roster-avatar', ged.GUI1, self._on_event), -('update-room-avatar', ged.GUI1, self._on_event), -('update-gc-avatar', ged.GUI1, self._on_event), ('muc-creation-failed', ged.GUI1, self._on_event), -('muc-joined', ged.GUI1, self._on_event), -('muc-join-failed', ged.GUI1, self._on_event), -('muc-user-joined', ged.GUI1, self._on_event), -('muc-user-left', ged.GUI1, self._on_event), -('muc-nickname-changed', ged.GUI1, self._on_event), ('muc-self-presence', ged.GUI1, self._on_event), -('muc-self-kicked', ged.GUI1, self._on_event), -('muc-user-affiliation-changed', ged.GUI1, self._on_event), -('muc-user-status-show-changed', ged.GUI1, self._on_event), -('muc-user-role-changed', ged.GUI1, self._on_event), -('muc-destroyed', ged.GUI1, self._on_event), -('muc-presence-error', ged.GUI1, self._on_event), -('muc-password-required', ged.GUI1, self._on_event), -('muc-config-changed', ged.GUI1, self._on_event), -('muc-subject', ged.GUI1, self._on_event), -('muc-captcha-challenge', ged.GUI1, self._on_event), -('muc-captcha-error', ged.GUI1, self._on_event), ('muc-voice-request', ged.GUI1, self._on_event), ('muc-disco-update', ged.GUI1, self._on_event), -('muc-configuration-finished', ged.GUI1, self._on_event), -('muc-configuration-failed', ged.GUI1, self._on_event), ('our-show', ged.GUI1, self._on_our_show), ('signed-in', ged.GUI1, self._on_signed_in), ]) = gajim/gui_interface.py = @@ -1732,21 +1732,6 @@ def process_connections(self): def save_config(): app.settings.save() -def update_avatar(self, account=None, jid=None, - contact=None, room_avatar=False): -self.avatar_storage.invalidate_cache(jid or contact.get_full_jid()) -if room_avatar: -app.nec.push_incoming_event( -NetworkEvent('update-room-avatar', account=account, jid=jid)) -elif contact is None: -app.nec.push_incoming_event( -NetworkEvent('update-roster-avatar', account=account, jid=jid)) -else: -app.nec.push_incoming_event(NetworkEvent('update-gc-avatar', - account=account, - contact=contact, - jid=contact.room_jid)) - def save_avatar(self, data): return self.avatar_storage.save_avatar(data) View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/ba5d7ead8c9f42779b188ca55fa65e58f9fe2578 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/ba5d7ead8c9f42779b188ca55fa65e58f9fe2578 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] Remove unused imports
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: 793ec22a by lovetox at 2021-03-01T22:31:39+01:00 Remove unused imports - - - - - 1 changed file: - gajim/privatechat_control.py Changes: = gajim/privatechat_control.py = @@ -26,10 +26,7 @@ from gajim.common import app from gajim.common import helpers -from gajim.common import ged from gajim.common.i18n import _ -from gajim.common.const import AvatarSize -from gajim.common.helpers import event_filter from gajim.chat_control import ChatControl from gajim.command_system.implementation.hosts import PrivateChatCommands View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/793ec22a72b3d127185f3d4d93d323edf50ae614 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/793ec22a72b3d127185f3d4d93d323edf50ae614 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] 2 commits: Add room-left signal
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: b8d30875 by lovetox at 2021-03-01T17:41:28+01:00 Add room-left signal - - - - - 57394b05 by lovetox at 2021-03-01T17:46:08+01:00 Fix muc user avatar update - - - - - 3 changed files: - gajim/common/modules/contacts.py - gajim/common/modules/muc.py - gajim/gui_interface.py Changes: = gajim/common/modules/contacts.py = @@ -147,10 +147,6 @@ def get_resource(self, resource): contact = self.add_resource(resource) return contact -# @property -# def groups(self): -# return self._module('Roster').get_groups(self._jid) - @property def is_available(self): return any([contact.is_available for contact in self._resources.values()]) @@ -333,7 +329,7 @@ def update_avatar(self, *args): def set_not_joined(self): for contact in self._resources.values(): -contact.update_presence(UNKNOWN_MUC_PRESENCE) +contact.update_presence(UNKNOWN_MUC_PRESENCE, notify=False) def get_user_nicknames(self): client = app.get_client(self._account) @@ -411,7 +407,11 @@ def get_avatar(self, return app.interface.avatar_storage.get_surface( self, size, scale, show, style=style) -def update_presence(self, presence, *args): +def update_presence(self, presence, *args, notify=True): +if not notify: +self._presence = presence +return + if not self._presence.available and presence.available: self._presence = presence self.notify('user-joined', *args) @@ -443,7 +443,7 @@ def set_state(self, state, presence): def update_avatar(self, *args): app.interface.avatar_storage.invalidate_cache(self._jid) -self.notify('avatar-update') +self.notify('user-avatar-update') def get_instance(*args: Any, **kwargs: Any) -> Tuple[Contacts, str]: = gajim/common/modules/muc.py = @@ -261,6 +261,7 @@ def leave(self, room_jid, reason=None): self._manager.set_state(room_jid, MUCJoinedState.NOT_JOINED) room = self._get_contact(room_jid) room.set_not_joined() +room.notify('room-left') def configure_room(self, room_jid): self._nbxmpp('MUC').request_config(room_jid, @@ -825,8 +826,9 @@ def reset_state(self): for muc in self._mucs.values(): self.set_state(muc.jid, MUCJoinedState.NOT_JOINED) self._joined_users.pop(muc.jid, None) -contact = client.get_module('Contacts').get_contact(muc.jid) -contact.set_not_joined() +room = client.get_module('Contacts').get_contact(muc.jid) +room.set_not_joined() +room.notify('room-left') def __contains__(self, room_jid): return room_jid in self._mucs = gajim/gui_interface.py = @@ -186,8 +186,7 @@ def _response(account, answer): args=[obj, 'yes'])]).show() def handle_event_iq_error(self, event): -ctrl = self.msg_win_mgr.get_control(event.properties.jid.bare, -event.account) +ctrl = app.window.get_control(event.account, event.properties.jid.bare) if ctrl and ctrl.is_groupchat: ctrl.add_info_message('Error: %s' % event.properties.error) View it on GitLab: https://dev.gajim.org/gajim/gajim/-/compare/6d5e9c5f5ce4980aab8a8e9a43ca01091eab1a7c...57394b050dda6ed9140c740ce2b0d01744b2d6f3 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/compare/6d5e9c5f5ce4980aab8a8e9a43ca01091eab1a7c...57394b050dda6ed9140c740ce2b0d01744b2d6f3 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] 109 commits: Adapt to nbxmpp chatstate changes
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: 213ee3cd by lovetox at 2021-02-27T11:44:52+01:00 Adapt to nbxmpp chatstate changes - - - - - 97080f7a by lovetox at 2021-02-27T12:16:09+01:00 UserAvatar: Handle empty data nodes - - - - - 508a0604 by lovetox at 2021-02-28T11:01:55+01:00 Use bare_match() bareMatch() is deprecated - - - - - 2bef238b by lovetox at 2021-03-01T16:26:37+01:00 StatusIcon: Only hide application when its focused - - - - - db6f0aa6 by lovetox at 2021-03-01T16:28:38+01:00 Windows: Open uris with webbrowser lib Trying to work around #10455 - - - - - 67cc179d by lovetox at 2021-03-01T17:03:06+01:00 StatusIcon: Refactor on_left_click() behavior - - - - - c553c29f by lovetox at 2021-03-01T17:25:42+01:00 Start - - - - - 4fafaecb by lovetox at 2021-03-01T17:25:42+01:00 Disable CI - - - - - f9e86897 by lovetox at 2021-03-01T17:25:42+01:00 Really disable CI - - - - - 7b71336d by lovetox at 2021-03-01T17:25:42+01:00 Add Workspace settings API - - - - - ac378186 by lovetox at 2021-03-01T17:25:42+01:00 Store and Open chats - - - - - 2f5be63f by lovetox at 2021-03-01T17:25:42+01:00 Add remove_chat() - - - - - 9f3db1cf by lovetox at 2021-03-01T17:25:42+01:00 Account Side Bar - - - - - 05a4c812 by lovetox at 2021-03-01T17:25:42+01:00 Add Workspace Side Bar - - - - - 5d8745f1 by wurstsalat at 2021-03-01T17:25:42+01:00 ChatList: Add basic elements - - - - - c08acfb0 by wurstsalat at 2021-03-01T17:25:42+01:00 ChatListStack: Add Start Chat - - - - - 5cf9031c by wurstsalat at 2021-03-01T17:25:42+01:00 Add basic Sidebar styling - - - - - beece50d by wurstsalat at 2021-03-01T17:25:42+01:00 Improve styling for Sidebar and ChatList - - - - - c9fc7716 by lovetox at 2021-03-01T17:25:42+01:00 Store chatlist on remove - - - - - 587648c7 by lovetox at 2021-03-01T17:25:42+01:00 Add/Remove Workspaces - - - - - 23edfcc7 by lovetox at 2021-03-01T17:25:42+01:00 Allow to add chats to different workspaces - - - - - 723f908d by lovetox at 2021-03-01T17:25:42+01:00 Add transparent backgrounds - - - - - 1ecd0417 by wurstsalat at 2021-03-01T17:25:42+01:00 AccountSideBar: Improve styling - - - - - 02267fd0 by wurstsalat at 2021-03-01T17:25:42+01:00 WorkspaceSidebar: Improve styling - - - - - 2c6f6074 by lovetox at 2021-03-01T17:25:42+01:00 Improve left sidebar - - - - - 12b843ae by lovetox at 2021-03-01T17:25:42+01:00 css - - - - - 3985de7a by lovetox at 2021-03-01T17:25:42+01:00 Dont fail when account is disabled - - - - - cdaed4a3 by lovetox at 2021-03-01T17:25:42+01:00 CSS - - - - - 95d8f9fb by wurstsalat at 2021-03-01T17:25:42+01:00 AvatarSelector: Add Load Image button - - - - - 62c3badc by Daniel Brötzmann at 2021-03-01T17:25:42+01:00 Workspace: Add Workspace edit dialog - - - - - 5de91862 by wurstsalat at 2021-03-01T17:25:42+01:00 Workspace: Add title and editing functionality - - - - - 028601b2 by wurstsalat at 2021-03-01T17:25:42+01:00 MainWindow: Add Paned for chat list and chat controls - - - - - aab34e84 by lovetox at 2021-03-01T17:25:42+01:00 Store type for open chats - - - - - 7051329d by lovetox at 2021-03-01T17:25:42+01:00 Store workspace dialog settings - - - - - ef1d8329 by lovetox at 2021-03-01T17:25:42+01:00 Fix adding new Workspace - - - - - 8194de85 by lovetox at 2021-03-01T17:25:42+01:00 Fix some selection bugs - - - - - 7947f848 by Daniel Brötzmann at 2021-03-01T17:25:42+01:00 ChatListStack: Wrap in ScrolledWindow - - - - - 0f3d7274 by lovetox at 2021-03-01T17:25:42+01:00 Move scrolled window into gui xml - - - - - 00b3635e by lovetox at 2021-03-01T17:25:42+01:00 sytle chatlist - - - - - 99e0dc76 by wurstsalat at 2021-03-01T17:25:42+01:00 ChatList: Styling - - - - - d9c82a5b by wurstsalat at 2021-03-01T17:25:42+01:00 MainWindow: Styling - - - - - f2e3338a by wurstsalat at 2021-03-01T17:25:42+01:00 Accounts: Add basic account page - - - - - 7d4b8ec4 by lovetox at 2021-03-01T17:25:42+01:00 Refactor Groupchats - - - - - 7d46af73 by lovetox at 2021-03-01T17:25:42+01:00 Start Chat: Destroy after joining MUC - - - - - eedc6248 by lovetox at 2021-03-01T17:25:42+01:00 Disable Roster - - - - - bb42b0da by lovetox at 2021-03-01T17:25:42+01:00 Make quit work - - - - - b0c68318 by lovetox at 2021-03-01T17:25:42+01:00 Stuff - - - - - 51545536 by Daniel Brötzmann at 2021-03-01T17:25:42+01:00 ChatList: Add friendly timestamps - - - - - 93d0c43b by Daniel Brötzmann at 2021-03-01T17:25:42+01:00 ChatList: Unread counter styling - - - - - c1522a93 by Daniel Brötzmann at 2021-03-01T17:25:42+01:00 ChatList: Group chat avatars and message lines - - - - - 5751dfa2 by Daniel Brötzmann at 2021-03-01T17:25:42+01:00 Paned: Improve ChatList resizing - - - - - f71c1212 by Daniel Brötzmann at 2021-03-01T17:25:42+01:00 ChatList: Use groupchat name, improve ellipsizing - - - - - fab002ef by Daniel Brötzmann at 2021-03-01T17:25:42+01:00 ChatList: Add group chat nicks - - - - - 58d1760d by lovetox at 2021-03-01T17:25:42+01:00 Remove unread_messages table
[Git][gajim/gajim] Pushed new tag gajim-1.3.1
Philipp Hörist pushed new tag gajim-1.3.1 at gajim / gajim -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/tree/gajim-1.3.1 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][gajim_1.3] 1.3.1
Philipp Hörist pushed to branch gajim_1.3 at gajim / gajim Commits: 8000e11a by lovetox at 2021-03-01T17:08:43+01:00 1.3.1 - - - - - 3 changed files: - appveyor.yml - data/org.gajim.Gajim.appdata.xml.in - gajim/__init__.py Changes: = appveyor.yml = @@ -39,8 +39,8 @@ build_script: bash "git clone C:/projects/gajim C:/msys64/home/appveyor/gajim" bash "C:/msys64/home/appveyor/gajim/win/build.sh $($env:MSYS_ARCH)" -Push-AppveyorArtifact "$($env:BUILDROOT)/Gajim.exe" -FileName "Gajim-1.3.0-$($env:ARCH)-$($env:TIME_STRING).exe" -Push-AppveyorArtifact "$($env:BUILDROOT)/Gajim-Portable.exe" -FileName "Gajim-Portable-1.3.0-$($env:ARCH)-$($env:TIME_STRING).exe" +Push-AppveyorArtifact "$($env:BUILDROOT)/Gajim.exe" -FileName "Gajim-1.3.1-$($env:ARCH)-$($env:TIME_STRING).exe" +Push-AppveyorArtifact "$($env:BUILDROOT)/Gajim-Portable.exe" -FileName "Gajim-Portable-1.3.1-$($env:ARCH)-$($env:TIME_STRING).exe" # on_finish: # - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) = data/org.gajim.Gajim.appdata.xml.in = @@ -72,6 +72,7 @@ intense + = gajim/__init__.py = @@ -2,7 +2,7 @@ import sys from pathlib import Path -__version__ = "1.3.0" +__version__ = "1.3.1" IS_FLATPAK = Path('/app/share/run-as-flatpak').exists() View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/8000e11adb50a8596d9360e2cbd34d699e0b398e -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/8000e11adb50a8596d9360e2cbd34d699e0b398e You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][gajim_1.3] Translated using Weblate (German)
Philipp Hörist pushed to branch gajim_1.3 at gajim / gajim Commits: 8e7d57ee by Daniel Brötzmann at 2021-03-01T17:02:57+01:00 Translated using Weblate (German) Currently translated at 100.0% (2219 of 2219 strings) Translation: Gajim/1.3 Translate-URL: https://translate.gajim.org/projects/gajim/1-3/de/ - - - - - 1 changed file: - po/de.po Changes: = po/de.po = @@ -13,7 +13,7 @@ msgstr "" "Project-Id-Version: gajim 0.13\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-01 17:44+0100\n" -"PO-Revision-Date: 2021-01-20 20:26+\n" +"PO-Revision-Date: 2021-02-15 17:22+\n" "Last-Translator: Daniel Brötzmann \n" "Language-Team: German <https://translate.gajim.org/projects/gajim/1-3/de/>\n" "Language: de\n" @@ -3855,7 +3855,7 @@ msgid "" "Do you want to join?" msgstr "" "hat dich in einen Gruppenchat eingeladen.\n" -"Willst du beitreten?" +"Möchtest du beitreten?" #: gajim/gtk/groupchat_invitation.py:75 gajim/gtk/discovery.py:1706 #: gajim/gtk/groupchat_join.py:68 gajim/data/gui/groupchat_control.ui:899 View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/8e7d57ee42fb98d553f2e3dfff26d982f3eb3348 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/8e7d57ee42fb98d553f2e3dfff26d982f3eb3348 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][master] StatusIcon: Refactor on_left_click() behavior
Philipp Hörist pushed to branch master at gajim / gajim Commits: 67cc179d by lovetox at 2021-03-01T17:03:06+01:00 StatusIcon: Refactor on_left_click() behavior - - - - - 1 changed file: - gajim/gtk/statusicon.py Changes: = gajim/gtk/statusicon.py = @@ -312,19 +312,24 @@ def _on_quit(_widget): def _on_left_click(self): win = app.interface.roster.window -if not app.events.get_systray_events(): -# No pending events, so toggle visible/hidden for roster window -if win.get_property('has-toplevel-focus'): -save_roster_position(win) -win.hide() -else: -win.show_all() -restore_roster_position(win) -if not app.settings.get('roster_window_skip_taskbar'): -win.set_property('skip-taskbar-hint', False) -win.present_with_time(Gtk.get_current_event_time()) -else: +if app.events.get_systray_events(): self._handle_first_event() +return + +if win.get_property('has-toplevel-focus'): +save_roster_position(win) +win.hide() +return + +visible = win.get_property('visible') +win.show_all() +if not visible: +# Window was minimized +restore_roster_position(win) + +if not app.settings.get('roster_window_skip_taskbar'): +win.set_property('skip-taskbar-hint', False) +win.present_with_time(Gtk.get_current_event_time()) @staticmethod def _handle_first_event(): View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/67cc179de367773bac11c029c6261a0179d49e7c -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/67cc179de367773bac11c029c6261a0179d49e7c You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][gajim_1.3] StatusIcon: Refactor on_left_click() behavior
Philipp Hörist pushed to branch gajim_1.3 at gajim / gajim Commits: 87deec9c by lovetox at 2021-03-01T17:02:15+01:00 StatusIcon: Refactor on_left_click() behavior - - - - - 1 changed file: - gajim/gtk/statusicon.py Changes: = gajim/gtk/statusicon.py = @@ -312,19 +312,24 @@ def _on_quit(_widget): def _on_left_click(self): win = app.interface.roster.window -if not app.events.get_systray_events(): -# No pending events, so toggle visible/hidden for roster window -if win.get_property('has-toplevel-focus'): -save_roster_position(win) -win.hide() -else: -win.show_all() -restore_roster_position(win) -if not app.settings.get('roster_window_skip_taskbar'): -win.set_property('skip-taskbar-hint', False) -win.present_with_time(Gtk.get_current_event_time()) -else: +if app.events.get_systray_events(): self._handle_first_event() +return + +if win.get_property('has-toplevel-focus'): +save_roster_position(win) +win.hide() +return + +visible = win.get_property('visible') +win.show_all() +if not visible: +# Window was minimized +restore_roster_position(win) + +if not app.settings.get('roster_window_skip_taskbar'): +win.set_property('skip-taskbar-hint', False) +win.present_with_time(Gtk.get_current_event_time()) @staticmethod def _handle_first_event(): View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/87deec9cd4ae68741f67570f7211c9c6f5f06883 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/87deec9cd4ae68741f67570f7211c9c6f5f06883 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][gajim_1.3] Update ChangeLog
Philipp Hörist pushed to branch gajim_1.3 at gajim / gajim Commits: 2a039f6a by lovetox at 2021-03-01T16:49:17+01:00 Update ChangeLog - - - - - 1 changed file: - ChangeLog Changes: = ChangeLog = @@ -1,3 +1,29 @@ +Gajim 1.3.1 (01 March 2021) + + New + + * Add setting for GSSAPI authentication + + Changes + + * #10416 Remove conversion of ASCII emojis + + Bug fixes + + * #10273 VcardWindow: Fix resource string if resource is missing + * #10424 GroupChatInvitation: Show account badge + * #10430 Preferences: Check for pipeline before removing elements + * #10436 Stop early when handling connection-failed in handle_event + * #10438 Set account window stack as non-vhomogeneous + * #10443 ServiceRegistration: Use nbxmpp register methods + * #10445 Change dataform to href markup URLs in fixed field + * #10450 Workaround for crash on clicking links + * AvatarSelector: Improve error handling + * Profile: Show error if avatar upload fails + * UserAvatar: Handle empty data nodes + * StatusIcon: Only hide application when its focused + + Gajim 1.3.0 (08 February 2021) New View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/2a039f6a3c5bcfda721f1e3a500ec3d36876e2ff -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/2a039f6a3c5bcfda721f1e3a500ec3d36876e2ff You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][gajim_1.3] StatusIcon: Only hide application when its focused
Philipp Hörist pushed to branch gajim_1.3 at gajim / gajim Commits: 2c41eee1 by lovetox at 2021-03-01T16:27:32+01:00 StatusIcon: Only hide application when its focused - - - - - 1 changed file: - gajim/gtk/statusicon.py Changes: = gajim/gtk/statusicon.py = @@ -314,10 +314,9 @@ def _on_left_click(self): win = app.interface.roster.window if not app.events.get_systray_events(): # No pending events, so toggle visible/hidden for roster window -if win.get_property('visible'): -if win.get_property('has-toplevel-focus') or os.name == 'nt': -save_roster_position(win) -win.hide() # else we hide it from VD that was visible in +if win.get_property('has-toplevel-focus'): +save_roster_position(win) +win.hide() else: win.show_all() restore_roster_position(win) View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/2c41eee113255731660ae6beacdb0c0d090f1347 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/2c41eee113255731660ae6beacdb0c0d090f1347 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][master] Windows: Open uris with webbrowser lib
Philipp Hörist pushed to branch master at gajim / gajim Commits: db6f0aa6 by lovetox at 2021-03-01T16:28:38+01:00 Windows: Open uris with webbrowser lib Trying to work around #10455 - - - - - 1 changed file: - gajim/common/helpers.py Changes: = gajim/common/helpers.py = @@ -47,6 +47,7 @@ import weakref import inspect import string +import webbrowser from string import Template import urllib from urllib.parse import unquote @@ -1099,13 +1100,22 @@ def open_uri(uri, account=None): open_file(uri.data) elif uri.type == URIType.TEL: -Gio.AppInfo.launch_default_for_uri(f'tel:{uri.data}') +if sys.platform == 'win32': +webbrowser.open(f'tel:{uri.data}') +else: +Gio.AppInfo.launch_default_for_uri(f'tel:{uri.data}') elif uri.type == URIType.MAIL: -Gio.AppInfo.launch_default_for_uri(f'mailto:{uri.data}') +if sys.platform == 'win32': +webbrowser.open(f'mailto:{uri.data}') +else: +Gio.AppInfo.launch_default_for_uri(f'mailto:{uri.data}') elif uri.type in (URIType.WEB, URIType.GEO): -Gio.AppInfo.launch_default_for_uri(uri.data) +if sys.platform == 'win32': +webbrowser.open(uri.data) +else: +Gio.AppInfo.launch_default_for_uri(uri.data) elif uri.type == URIType.AT: app.interface.new_chat_from_jid(account, uri.data) View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/db6f0aa6b503b5c4394366c24a53cea7d124e4cb -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/db6f0aa6b503b5c4394366c24a53cea7d124e4cb You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][master] StatusIcon: Only hide application when its focused
Philipp Hörist pushed to branch master at gajim / gajim Commits: 2bef238b by lovetox at 2021-03-01T16:26:37+01:00 StatusIcon: Only hide application when its focused - - - - - 1 changed file: - gajim/gtk/statusicon.py Changes: = gajim/gtk/statusicon.py = @@ -314,10 +314,9 @@ def _on_left_click(self): win = app.interface.roster.window if not app.events.get_systray_events(): # No pending events, so toggle visible/hidden for roster window -if win.get_property('visible'): -if win.get_property('has-toplevel-focus') or os.name == 'nt': -save_roster_position(win) -win.hide() # else we hide it from VD that was visible in +if win.get_property('has-toplevel-focus'): +save_roster_position(win) +win.hide() else: win.show_all() restore_roster_position(win) View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/2bef238b37832f0e9b327636ed1b01ba6f372d80 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/2bef238b37832f0e9b327636ed1b01ba6f372d80 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] Contacts: Fix access to roster attr
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: e9f3deb7 by lovetox at 2021-03-01T00:17:08+01:00 Contacts: Fix access to roster attr - - - - - 1 changed file: - gajim/common/modules/contacts.py Changes: = gajim/common/modules/contacts.py = @@ -172,10 +172,13 @@ def chatstate(self): @property def name(self): +roster_name = self._get_roster_attr('name') +if roster_name: +return roster_name nickname = app.storage.cache.get_contact(self._jid, 'nickname') -if nickname is None: -return self._jid.localpart -return nickname +if nickname: +return nickname +return self._jid.localpart @property def avatar_sha(self): @@ -216,7 +219,7 @@ def _get_roster_attr(self, attr): item = self._module('Roster').get_item(self._jid) if item is None: return None -return item.get(attr) +return getattr(item, attr) @property def is_in_roster(self): View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/e9f3deb7e763a92ed4d110b719650f7c86148d57 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/e9f3deb7e763a92ed4d110b719650f7c86148d57 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/python-nbxmpp][master] Remove unused import
Philipp Hörist pushed to branch master at gajim / python-nbxmpp Commits: 7c9883fe by lovetox at 2021-02-28T23:46:15+01:00 Remove unused import - - - - - 1 changed file: - nbxmpp/modules/roster.py Changes: = nbxmpp/modules/roster.py = @@ -19,7 +19,6 @@ from nbxmpp.namespaces import Namespace from nbxmpp.simplexml import Node from nbxmpp.protocol import Iq -from nbxmpp.protocol import JID from nbxmpp.protocol import NodeProcessed from nbxmpp.structs import RosterData from nbxmpp.structs import RosterItem View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/-/commit/7c9883fe4119bc8fe16df27578a3d776e6609394 -- View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/-/commit/7c9883fe4119bc8fe16df27578a3d776e6609394 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/gajim][mainwindow] Fix MUC rejoins
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: 3d2cc2e6 by lovetox at 2021-02-28T17:55:38+01:00 Fix MUC rejoins - - - - - 2 changed files: - gajim/common/modules/contacts.py - gajim/common/modules/muc.py Changes: = gajim/common/modules/contacts.py = @@ -328,7 +328,7 @@ def update_avatar(self, *args): app.interface.avatar_storage.invalidate_cache(self._jid) self.notify('avatar-update') -def set_destroyed(self): +def set_not_joined(self): for contact in self._resources.values(): contact.update_presence(UNKNOWN_MUC_PRESENCE) = gajim/common/modules/muc.py = @@ -251,7 +251,6 @@ def leave(self, room_jid, reason=None): self._remove_join_timeout(room_jid) self._remove_rejoin_timeout(room_jid) -self._manager.set_state(room_jid, MUCJoinedState.NOT_JOINED) self._con.get_module('Presence').send_presence( muc_data.occupant_jid, @@ -259,6 +258,10 @@ def leave(self, room_jid, reason=None): status=reason, caps=False) +self._manager.set_state(room_jid, MUCJoinedState.NOT_JOINED) +room = self._get_contact(room_jid) +room.set_not_joined() + def configure_room(self, room_jid): self._nbxmpp('MUC').request_config(room_jid, callback=self._on_room_config) @@ -356,12 +359,17 @@ def change_nick(self, room_jid, new_nick): show=status, status=message) -def _on_error_presence(self, _con, _stanza, properties): +def _on_error_presence(self, _con, stanza, properties): room_jid = properties.jid.bare muc_data = self._manager.get(room_jid) if muc_data is None: return +if properties.jid.resource != muc_data.nick: +self._log.warning('Unknown error presence') +self._log.warning(stanza) +return + room = self._get_contact(room_jid) if muc_data.state == MUCJoinedState.JOINING: @@ -387,9 +395,9 @@ def _on_error_presence(self, _con, _stanza, properties): room.notify('room-creation-failed', properties) elif muc_data.state == MUCJoinedState.CAPTCHA_REQUEST: -room.notify('room-captcha-error', properties.error) self._manager.set_state(room_jid, MUCJoinedState.CAPTCHA_FAILED) self._manager.set_state(room_jid, MUCJoinedState.NOT_JOINED) +room.notify('room-captcha-error', properties.error) elif muc_data.state == MUCJoinedState.CAPTCHA_FAILED: self._manager.set_state(room_jid, MUCJoinedState.NOT_JOINED) @@ -415,6 +423,7 @@ def _on_muc_user_presence(self, _con, stanza, properties): self._log.info('MUC destroyed: %s', room_jid) self._remove_join_timeout(room_jid) self._manager.set_state(room_jid, MUCJoinedState.NOT_JOINED) +room.set_not_joined() room.notify('destroyed', properties) return @@ -466,6 +475,7 @@ def _on_muc_user_presence(self, _con, stanza, properties): if properties.is_muc_self_presence and properties.is_kicked: self._manager.set_state(room_jid, MUCJoinedState.NOT_JOINED) +room.set_not_joined() room.notify('kicked', properties) status_codes = properties.muc_status_codes or [] if StatusCode.REMOVED_SERVICE_SHUTDOWN in status_codes: @@ -786,6 +796,7 @@ def add(self, muc): def remove(self, muc): self._mucs.pop(muc.jid, None) +self._joined_users.pop(muc.jid, None) def get(self, room_jid): return self._mucs.get(room_jid) @@ -796,6 +807,7 @@ def set_state(self, room_jid, state): if muc.state == state: return self._log.info('Set MUC state: %s %s', room_jid, state) + muc.state = state self.notify('state-changed', state, @@ -809,8 +821,12 @@ def get_mucs_with_state(self, states): return [muc for muc in self._mucs.values() if muc.state in states] def reset_state(self): +client = app.get_client(self._account) for muc in self._mucs.values(): self.set_state(muc.jid, MUCJoinedState.NOT_JOINED) +self._joined_users.pop(muc.jid, None) +contact = client.get_module('Contacts').get_contact(muc.jid) +contact.set_not_joined() def __contains__(self, room_jid): return room_jid in self._mucs View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/3d2cc2e65ef8e4a6d4932f0e0032c9a8f7468635 -- View it on GitLab: https://
[Git][gajim/gajim][mainwindow] Settings: Add json encoder/decoder
Philipp Hörist pushed to branch mainwindow at gajim / gajim Commits: 7df4170c by lovetox at 2021-02-28T13:27:46+01:00 Settings: Add json encoder/decoder - - - - - 3 changed files: - gajim/chat_control_base.py - gajim/common/settings.py - gajim/gtk/main.py Changes: = gajim/chat_control_base.py = @@ -1045,6 +1045,8 @@ def _on_window_motion_notify(self, *args): if not self.parent_win: # when a groupchat is minimized there is no parent window return +# TODO +return if self.parent_win.get_active_jid() == self.contact.jid: # if window is the active one, set last interaction con = app.connections[self.account] = gajim/common/settings.py = @@ -29,6 +29,7 @@ from collections import defaultdict from gi.repository import GLib +from nbxmpp.protocol import JID from gajim import IS_PORTABLE from gajim.common import app @@ -76,6 +77,22 @@ json.dumps(INITAL_WORKSPACE)) +class Encoder(json.JSONEncoder): +def default(self, obj): +if isinstance(obj, JID): +return {'__type': 'JID', 'value': str(obj)} +return json.JSONEncoder.default(self, obj) + + +def json_decoder(dct): +type_ = dct.get('__type') +if type_ is None: +return dct +if type_ == 'JID': +return JID.from_string(dct['value']) +return dct + + class Settings: def __init__(self): self._con = None @@ -434,14 +451,17 @@ def _load_settings(self) -> None: settings = self._con.execute('SELECT * FROM settings').fetchall() for row in settings: log.info('Load %s settings', row.name) -self._settings[row.name] = json.loads(row.settings) +self._settings[row.name] = json.loads(row.settings, + object_hook=json_decoder) def _load_account_settings(self) -> None: account_settings = self._con.execute( 'SELECT * FROM account_settings').fetchall() for row in account_settings: log.info('Load account settings: %s', row.account) -self._account_settings[row.account] = json.loads(row.settings) +self._account_settings[row.account] = json.loads( +row.settings, +object_hook=json_decoder) def _commit_account_settings(self, account: str, @@ -449,7 +469,7 @@ def _commit_account_settings(self, log.info('Set account settings: %s', account) self._con.execute( 'UPDATE account_settings SET settings = ? WHERE account = ?', -(json.dumps(self._account_settings[account]), account)) +(json.dumps(self._account_settings[account], cls=Encoder), account)) self._commit(schedule=schedule) @@ -457,7 +477,7 @@ def _commit_settings(self, name: str, schedule: bool = True) -> None: log.info('Set settings: %s', name) self._con.execute( 'UPDATE settings SET settings = ? WHERE name = ?', -(json.dumps(self._settings[name]), name)) +(json.dumps(self._settings[name], cls=Encoder), name)) self._commit(schedule=schedule) = gajim/gtk/main.py = @@ -482,8 +482,10 @@ def _load_chats(self): self._chat_list_stack.add_chat_list(workspace_id) open_chats = app.settings.get_workspace_setting(workspace_id, 'open_chats') + +active_accounts = app.settings.get_active_accounts() for account, jid, type_, pinned in open_chats: -if account not in app.connections: +if account not in active_accounts: continue self.add_chat_for_workspace(workspace_id, account, jid, type_, pinned=pinned) View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/7df4170c8029cde0320366adcd01f766bf6893f9 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/7df4170c8029cde0320366adcd01f766bf6893f9 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/python-nbxmpp][master] Protocol: Make JID a dataclass obj
Philipp Hörist pushed to branch master at gajim / python-nbxmpp Commits: dbed818f by lovetox at 2021-02-28T13:26:53+01:00 Protocol: Make JID a dataclass obj - - - - - 1 changed file: - nbxmpp/protocol.py Changes: = nbxmpp/protocol.py = @@ -23,7 +23,8 @@ import hashlib import functools import warnings from base64 import b64encode -from collections import namedtuple +from dataclasses import dataclass +from dataclasses import asdict from gi.repository import GLib @@ -584,25 +585,23 @@ def unescape_localpart(localpart): return localpart -class JID(namedtuple('JID', - ['jid', 'localpart', 'domain', 'resource'])): - -__slots__ = [] - -def __new__(cls, jid=None, localpart=None, domain=None, resource=None): -if jid is not None: -deprecation_warning('JID(jid) is deprecated, use from_string()') -return JID.from_string(str(jid)) +@dataclass(frozen=True) +class JID: +localpart: str = None +domain: str = None +resource: str = None +def __init__(self, localpart=None, domain=None, resource=None): if localpart is not None: localpart = validate_localpart(localpart) +object.__setattr__(self, "localpart", localpart) domain = validate_domainpart(domain) +object.__setattr__(self, "domain", domain) if resource is not None: resource = validate_resourcepart(resource) - -return super().__new__(cls, None, localpart, domain, resource) +object.__setattr__(self, "resource", resource) @classmethod @functools.lru_cache(maxsize=None) @@ -625,8 +624,7 @@ class JID(namedtuple('JID', else: localpart, domainpart = None, rest -return cls(jid=None, - localpart=localpart, +return cls(localpart=localpart, domain=domainpart, resource=resourcepart) @@ -659,8 +657,7 @@ class JID(namedtuple('JID', localpart = None domainpart = user_input -return cls(jid=None, - localpart=localpart, +return cls(localpart=localpart, domain=domainpart, resource=None) @@ -684,7 +681,13 @@ class JID(namedtuple('JID', return JID.from_string(other) == self except Exception: return False -return super().__eq__(other) + +if not isinstance(other, JID): +raise TypeError('eq with type (%s) not supported' % type(other)) + +return (self.localpart == other.localpart and +self.domain == other.domain and +self.resource == other.resource) def __ne__(self, other): return not self.__eq__(other) @@ -705,7 +708,9 @@ class JID(namedtuple('JID', def new_as_bare(self): if self.resource is None: return self -return self._replace(resource=None) +new = asdict(self) +new.pop('resource') +return JID(**new) def bare_match(self, other): if isinstance(other, str): @@ -723,7 +728,9 @@ class JID(namedtuple('JID', self.resource is not None) def new_with(self, **kwargs): -return self._replace(**kwargs) +new = asdict(self) +new.update(kwargs) +return JID(**new) def to_user_string(self, show_punycode=True): domain = self.domain_to_ascii() View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/-/commit/dbed818fff4585fb05f5f113702ca8a26604cffd -- View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/-/commit/dbed818fff4585fb05f5f113702ca8a26604cffd You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits
[Git][gajim/python-nbxmpp][master] Protocol: Remove deprecated JID methods
Philipp Hörist pushed to branch master at gajim / python-nbxmpp Commits: 8847d2f3 by lovetox at 2021-02-28T11:02:53+01:00 Protocol: Remove deprecated JID methods - - - - - 1 changed file: - nbxmpp/protocol.py Changes: = nbxmpp/protocol.py = @@ -741,57 +741,10 @@ class JID(namedtuple('JID', return f'{localpart}@{self.domain}{domain_encoded}' return f'{localpart}@{self.domain}/{self.resource}{domain_encoded}' -def bareMatch(self, other): -deprecation_warning('bareMatch() is deprected use bare_match()') -return self.bare_match(other) - -@property -def isBare(self): -deprecation_warning('isBare() is deprected use ' -'the attribute is_bare') -return self.is_bare - -@property -def isDomain(self): -deprecation_warning('isDomain() is deprected use ' -'the attribute is_domain') -return self.is_domain - -@property -def isFull(self): -deprecation_warning('isFull() is deprected use ' -'the attribute is_full') -return self.is_full - def copy(self): deprecation_warning('copy() is not needed, JID is immutable') return self -def getNode(self): -deprecation_warning('getNode() is deprected use ' -'the attribute localpart') -return self.localpart - -def getDomain(self): -deprecation_warning('getDomain() is deprected use ' -'the attribute domain') -return self.domain - -def getResource(self): -deprecation_warning('getResource() is deprected use ' -'the attribute resource') -return self.resource - -def getStripped(self): -deprecation_warning('getStripped() is deprected use ' -'the attribute bare') -return self.bare - -def getBare(self): -deprecation_warning('getBare() is deprected use ' -'the attribute bare') -return self.bare - class StreamErrorNode(Node): def __init__(self, node): View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/-/commit/8847d2f3b81ed3f2a12d5e1fab9839cf106be824 -- View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/-/commit/8847d2f3b81ed3f2a12d5e1fab9839cf106be824 You're receiving this email because of your account on dev.gajim.org. ___ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits