Philipp Hörist pushed to branch gajim_1.0 at gajim / gajim
Commits:
8e479697 by Markus Wintermann at 2018-05-19T09:45:59+02:00
Select account in account list if edited
Before: After a rightclick -> "Modify Account" on an account in the
roster the preferences of the account are shown but the account is not
selected in the account list.
After: account will be selected in the account list too
- - - - -
0fdb4791 by Philipp Hörist at 2018-05-19T09:46:30+02:00
Set no-store hint on groupchat chatstates
- - - - -
6b804159 by Philipp Hörist at 2018-05-19T09:47:01+02:00
Dont show OOB uri if message body is the same
if oob uri == body there is no need to show the uri
below the message
- - - - -
71648f92 by Philipp Hörist at 2018-05-19T09:47:19+02:00
Bring control to front when notification is clicked
if autopopup_chat_opened is activated no control is found because
the event that triggered the notification is already deleted when
the notification is clicked by the user. So instead of searching
for the event, search for the control with jid/account.
Fixes #9124
- - - - -
56067cfd by Philipp Hörist at 2018-05-19T09:49:14+02:00
Init Roster after stream management resume
nbxmpp deletes the roster object on disconnect. Init the roster from db
again on resume.
Fixes #8296
- - - - -
c0c6380c by Philipp Hörist at 2018-05-19T09:49:26+02:00
Add pybonjour to deps on Windows
Fixes #9125
- - - - -
22871918 by Philipp Hörist at 2018-05-19T09:51:17+02:00
Fix Windows build
- - - - -
7 changed files:
- appveyor.yml
- gajim/accounts_window.py
- gajim/common/connection.py
- gajim/common/connection_handlers.py
- gajim/conversation_textview.py
- gajim/gui_interface.py
- win/_base.sh
Changes:
=====================================
appveyor.yml
=====================================
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -18,7 +18,7 @@ clone_depth: 1
# - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
build_script:
- - C:\msys64\usr\bin\pacman -Syuu --needed --noconfirm --ask=127
+ - C:\msys64\usr\bin\pacman -Syu --needed --noconfirm --ask=20
- ps: |
$env:TIME_STRING=(get-date -UFormat "%Y-%m-%d").ToString()
$env:BUILDROOT="C:\msys64\home\appveyor\gajim\win\_build_root"
=====================================
gajim/accounts_window.py
=====================================
--- a/gajim/accounts_window.py
+++ b/gajim/accounts_window.py
@@ -234,6 +234,7 @@ class AccountsWindow(Gtk.ApplicationWindow):
def select_account(self, account):
for row in self.account_list.get_children():
if row.get_child().account == account:
+ self.account_list.select_row(row)
self.account_list.emit('row-activated', row)
break
=====================================
gajim/common/connection.py
=====================================
--- a/gajim/common/connection.py
+++ b/gajim/common/connection.py
@@ -1852,6 +1852,8 @@ class Connection(CommonConnection, ConnectionHandlers):
our_server = app.config.get_per('accounts', self.name, 'hostname')
self.discoverInfo(our_jid, id_prefix='Gajim_')
self.discoverInfo(our_server, id_prefix='Gajim_')
+ else:
+ self.request_roster(resume=True)
self.sm.resuming = False # back to previous state
# Discover Stun server(s)
@@ -2550,16 +2552,25 @@ class Connection(CommonConnection, ConnectionHandlers):
iq3.addChild(name='meta', attrs=dict_)
self.connection.send(iq)
- def request_roster(self):
+ def request_roster(self, resume=False):
version = None
features = self.connection.Dispatcher.Stream.features
- if features and features.getTag('ver',
- namespace=nbxmpp.NS_ROSTER_VER):
- version = app.config.get_per('accounts', self.name,
- 'roster_version')
+ if features and features.getTag('ver', namespace=nbxmpp.NS_ROSTER_VER):
+ version = app.config.get_per(
+ 'accounts', self.name, 'roster_version')
+
+ iq_id = self.connection.initRoster(version=version,
+ request=not resume)
+ if resume:
+ self._init_roster_from_db()
+ else:
+ self.awaiting_answers[iq_id] = (ROSTER_ARRIVED, )
- iq_id = self.connection.initRoster(version=version)
- self.awaiting_answers[iq_id] = (ROSTER_ARRIVED, )
+ def _init_roster_from_db(self):
+ account_jid = app.get_jid_from_account(self.name)
+ roster_data = app.logger.get_roster(account_jid)
+ roster = self.connection.getRoster(force=True)
+ roster.setRaw(roster_data)
def send_agent_status(self, agent, ptype):
if not app.account_is_connected(self.name):
@@ -2683,6 +2694,8 @@ class Connection(CommonConnection, ConnectionHandlers):
if obj.chatstate:
msg_iq.setTag(obj.chatstate, namespace=nbxmpp.NS_CHATSTATES)
+ if not obj.message:
+ msg_iq.setTag('no-store', namespace=nbxmpp.NS_MSG_HINTS)
if obj.label is not None:
msg_iq.addChild(node=obj.label)
=====================================
gajim/common/connection_handlers.py
=====================================
--- a/gajim/common/connection_handlers.py
+++ b/gajim/common/connection_handlers.py
@@ -1497,10 +1497,7 @@ ConnectionHTTPUpload):
elif self.awaiting_answers[id_][0] == ROSTER_ARRIVED:
if iq_obj.getType() == 'result':
if not iq_obj.getTag('query'):
- account_jid = app.get_jid_from_account(self.name)
- roster_data = app.logger.get_roster(account_jid)
- roster = self.connection.getRoster(force=True)
- roster.setRaw(roster_data)
+ self._init_roster_from_db()
self._getRoster()
elif iq_obj.getType() == 'error':
self.roster_supported = False
=====================================
gajim/conversation_textview.py
=====================================
--- a/gajim/conversation_textview.py
+++ b/gajim/conversation_textview.py
@@ -842,10 +842,9 @@ class ConversationTextview(GObject.GObject):
except KeyError:
pass
else:
- oob_desc = additional_data['gajim'].get('oob_desc', None)
- if oob_desc is None:
- oob_desc = _('URL:')
- otext += '\n{} {}'.format(oob_desc, oob_url)
+ oob_desc = additional_data['gajim'].get('oob_desc', 'URL:')
+ if oob_url != otext:
+ otext += '\n{} {}'.format(oob_desc, oob_url)
# basic: links + mail + formatting is always checked (we like that)
if app.config.get('emoticons_theme') and graphics:
=====================================
gajim/gui_interface.py
=====================================
--- a/gajim/gui_interface.py
+++ b/gajim/gui_interface.py
@@ -1708,7 +1708,15 @@ class Interface:
if not event:
event = app.events.get_first_event(account, jid, type_)
if not event:
- return
+ # If autopopup_chat_opened = True, then we send out
+ # notifications even if a control is open. This means the
+ # event is already deleted (because its printed to the
+ # control) when the notification is clicked. So try to
+ # get a control from account/jid
+ ctrl = self.msg_win_mgr.get_control(fjid, account)
+ if ctrl is None:
+ return
+ w = ctrl.parent_win
if type_ == 'printed_chat':
ctrl = event.control
=====================================
win/_base.sh
=====================================
--- a/win/_base.sh
+++ b/win/_base.sh
@@ -80,28 +80,27 @@ function install_deps {
mingw-w64-"${ARCH}"-goocanvas \
mingw-w64-"${ARCH}"-gspell \
mingw-w64-"${ARCH}"-hunspell \
- mingw-w64-"${ARCH}"-"${PYTHON_ID}"-setuptools
-
- build_pip install setuptools_scm
+ mingw-w64-"${ARCH}"-"${PYTHON_ID}"-setuptools \
+ mingw-w64-"${ARCH}"-"${PYTHON_ID}"-pillow \
+ mingw-w64-"${ARCH}"-"${PYTHON_ID}"-setuptools-scm \
+ mingw-w64-"${ARCH}"-"${PYTHON_ID}"-cryptography \
+ mingw-w64-"${ARCH}"-"${PYTHON_ID}"-pyopenssl \
+ mingw-w64-"${ARCH}"-"${PYTHON_ID}"-docutils \
+ mingw-w64-"${ARCH}"-"${PYTHON_ID}"-certifi \
+ mingw-w64-"${ARCH}"-"${PYTHON_ID}"-six
PIP_REQUIREMENTS="\
pyasn1
-certifi
git+https://dev.gajim.org/gajim/python-nbxmpp.gitgit+https://github.com/dlitz/pycrypto.git
-cryptography
-pyopenssl
+git+https://dev.gajim.org/lovetox/pybonjour-python3.git
+keyring
python-gnupg
-docutils
+python-axolotl
qrcode
-keyring
-pillow==4.3.0
-six
"
- build_pip install --no-binary ":all:" \
- --force-reinstall $(echo "$PIP_REQUIREMENTS" | tr ["\\n"] [" "])
- build_pip install python-axolotl
+ build_pip install $(echo "$PIP_REQUIREMENTS" | tr ["\\n"] [" "])
# remove the large png icons, they should be used rarely and svg works fine
rm -Rf "${MINGW_ROOT}/share/icons/Adwaita/512x512"
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/f99ec91fc29c7ae822856b318537e565e…
---
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/f99ec91fc29c7ae822856b318537e565e…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / python-nbxmpp
Commits:
964d31b5 by Philipp Hörist at 2018-05-18T17:11:06+02:00
Pass arguments to plugin/plugout method
- - - - -
467572b7 by Philipp Hörist at 2018-05-18T17:14:18+02:00
Allow initRoster without requesting the roster
- - - - -
2 changed files:
- nbxmpp/client_nb.py
- nbxmpp/plugin.py
Changes:
=====================================
nbxmpp/client_nb.py
=====================================
--- a/nbxmpp/client_nb.py
+++ b/nbxmpp/client_nb.py
@@ -601,12 +601,13 @@ class NonBlockingClient(object):
self.NonBlockingBind.NonBlockingBind(self._Resource, self._on_sasl_auth)
return True
- def initRoster(self, version=''):
+ def initRoster(self, version='', request=True):
"""
Plug in the roster
"""
if 'NonBlockingRoster' not in self.__dict__:
- return roster_nb.NonBlockingRoster.get_instance(version=version).PlugIn(self)
+ return roster_nb.NonBlockingRoster.get_instance(
+ version=version).PlugIn(self, request=request)
def getRoster(self, on_ready=None, force=False):
"""
=====================================
nbxmpp/plugin.py
=====================================
--- a/nbxmpp/plugin.py
+++ b/nbxmpp/plugin.py
@@ -37,7 +37,7 @@ class PlugIn(object):
def __init__(self):
self._exported_methods=[]
- def PlugIn(self, owner):
+ def PlugIn(self, owner, *args, **kwargs):
"""
Attach to owner and register ourself and our _exported_methods in it.
If defined by a subclass, call self.plugin(owner) to execute hook
@@ -62,9 +62,9 @@ class PlugIn(object):
# Execute hook
if hasattr(self, 'plugin'):
- return self.plugin(owner)
+ return self.plugin(owner, *args, **kwargs)
- def PlugOut(self):
+ def PlugOut(self, *args, **kwargs):
"""
Unregister our _exported_methods from owner and detach from it.
If defined by a subclass, call self.plugout() after unplugging to execute
@@ -82,7 +82,7 @@ class PlugIn(object):
del self._owner.__dict__[self.__class__.__name__]
# Execute hook
if hasattr(self, 'plugout'):
- return self.plugout()
+ return self.plugout(*args, **kwargs)
del self._owner
@classmethod
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/compare/e471a74e40d378d2c27e1a045…
---
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/compare/e471a74e40d378d2c27e1a045…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
6ed04e2d by Philipp Hörist at 2018-05-17T21:13:37+02:00
Simplify generating random int
No need to use SystemRandom() here, as this is not needed for security
purposes
- - - - -
1 changed file:
- gajim/common/connection.py
Changes:
=====================================
gajim/common/connection.py
=====================================
--- a/gajim/common/connection.py
+++ b/gajim/common/connection.py
@@ -49,12 +49,6 @@ from string import Template
from urllib.request import urlopen
from urllib.error import URLError
-try:
- randomsource = random.SystemRandom()
-except Exception:
- randomsource = random.Random()
- randomsource.seed()
-
if os.name == 'nt':
import certifi
import OpenSSL.crypto
@@ -805,7 +799,7 @@ class Connection(CommonConnection, ConnectionHandlers):
# do exponential backoff until less than 5 minutes
if self.retrycount < 2 or self.last_time_to_reconnect is None:
self.last_time_to_reconnect = 5
- self.last_time_to_reconnect += randomsource.randint(0, 5)
+ self.last_time_to_reconnect += random.randint(0, 5)
if self.last_time_to_reconnect < 200:
self.last_time_to_reconnect *= 1.5
self.time_to_reconnect = int(self.last_time_to_reconnect)
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/6ed04e2dd2d91b92dbafbdaa6e101822f0…
---
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/6ed04e2dd2d91b92dbafbdaa6e101822f0…
You're receiving this email because of your account on dev.gajim.org.