Philipp Hörist pushed to branch master at gajim / gajim
Commits:
dbbd3fe1 by Philipp Hörist at 2017-08-14T15:02:55+02:00
Fix broken menus when renaming an account
- - - - -
1 changed file:
- gajim/config.py
Changes:
=====================================
gajim/config.py
=====================================
--- a/gajim/config.py
+++ b/gajim/config.py
@@ -2156,6 +2156,9 @@ class AccountsWindow:
gajim.interface.roster.setup_and_draw_roster()
self.init_accounts()
self.select_account(new_name)
+ gajim.app.remove_account_actions(old_name)
+ gajim.app.add_account_actions(new_name)
+ gui_menu_builder.build_accounts_menu()
title = _('Rename Account')
message = _('Enter a new name for account %s') % self.current_account
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/dbbd3fe11138e83d4e912040c90071ce1e…
---
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/dbbd3fe11138e83d4e912040c90071ce1e…
You're receiving this email because of your account on dev.gajim.org.
Yann Leboulanger pushed to branch master at gajim / gajim
Commits:
f8383954 by Yann Leboulanger at 2017-08-14T14:44:04+02:00
Fix socks5 problem:
receive() returns bytes, not str
- - - - -
1 changed file:
- gajim/common/socks5.py
Changes:
=====================================
gajim/common/socks5.py
=====================================
--- a/gajim/common/socks5.py
+++ b/gajim/common/socks5.py
@@ -145,10 +145,10 @@ class SocksQueue:
self.add_sockobj(account, socks5obj)
else:
if 'candidate_id' in streamhost:
- log.debug('Trying to connect as sender to cid' + \
+ log.debug('Trying to connect as sender to cid ' + \
streamhost['candidate_id'])
else:
- log.debug('Trying to connect as sender to jid' + \
+ log.debug('Trying to connect as sender to jid ' + \
streamhost['jid'])
if file_props.sha_str:
idx = file_props.sha_str
@@ -1208,7 +1208,7 @@ class Socks5Client(Socks5):
"""
result = 1
buff = self.receive()
- if buff == '':
+ if buff == b'':
# end connection
self.pollend()
return
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/f8383954e38c9f0c7665b9d69a52004e4c…
---
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/f8383954e38c9f0c7665b9d69a52004e4c…
You're receiving this email because of your account on dev.gajim.org.
Yann Leboulanger pushed to branch gajim_0.16 at gajim / gajim
Commits:
59b3b3ae by Yann Leboulanger at 2017-08-13T23:05:25+02:00
do not create Event when we auto popup a normal message. Fixes #8645
- - - - -
1 changed file:
- src/session.py
Changes:
=====================================
src/session.py
=====================================
--- a/src/session.py
+++ b/src/session.py
@@ -247,18 +247,24 @@ class ChatControlSession(stanza_session.EncryptedStanzaSession):
# We have a ChatControl open
obj.show_in_roster = False
obj.show_in_systray = False
+ do_event = False
elif obj.forwarded and obj.sent:
# Its a Carbon Copied Message we sent
obj.show_in_roster = False
obj.show_in_systray = False
gajim.events.remove_events(self.conn.name, fjid, types=['chat'])
+ do_event = False
else:
# Everything else
obj.show_in_roster = notify.get_show_in_roster(event_type,
self.conn.name, contact, self)
obj.show_in_systray = notify.get_show_in_systray(event_type,
self.conn.name, contact)
-
+ if obj.mtype == 'normal' and not obj.popup:
+ do_event = False
+ else:
+ do_event = True
+ if do_event:
event = event_t(obj.msgtxt, obj.subject, obj.mtype, obj.timestamp,
obj.encrypted, obj.resource, obj.msg_log_id,
correct_id=(obj.id_, obj.correct_id), xhtml=obj.xhtml,
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/59b3b3aed94ad143a16261a9f8e171c41c…
---
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/59b3b3aed94ad143a16261a9f8e171c41c…
You're receiving this email because of your account on dev.gajim.org.
Yann Leboulanger pushed to branch master at gajim / gajim
Commits:
9b866fd1 by Yann Leboulanger at 2017-08-13T23:03:11+02:00
do not create Event when we auto popup a normal message. Fixes #8645
- - - - -
1 changed file:
- gajim/session.py
Changes:
=====================================
gajim/session.py
=====================================
--- a/gajim/session.py
+++ b/gajim/session.py
@@ -242,18 +242,24 @@ class ChatControlSession(stanza_session.EncryptedStanzaSession):
# We have a ChatControl open
obj.show_in_roster = False
obj.show_in_systray = False
+ do_event = False
elif obj.forwarded and obj.sent:
# Its a Carbon Copied Message we sent
obj.show_in_roster = False
obj.show_in_systray = False
gajim.events.remove_events(self.conn.name, fjid, types=['chat'])
+ do_event = False
else:
# Everything else
obj.show_in_roster = notify.get_show_in_roster(event_type,
self.conn.name, contact, self)
obj.show_in_systray = notify.get_show_in_systray(event_type,
self.conn.name, contact)
-
+ if obj.mtype == 'normal' and not obj.popup:
+ do_event = False
+ else:
+ do_event = True
+ if do_event:
event = event_t(obj.msgtxt, obj.subject, obj.mtype, obj.timestamp,
obj.encrypted, obj.resource, obj.msg_log_id,
correct_id=(obj.id_, obj.correct_id), xhtml=obj.xhtml,
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/9b866fd1a05ddd37d70aecda9c605d2040…
---
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/9b866fd1a05ddd37d70aecda9c605d2040…
You're receiving this email because of your account on dev.gajim.org.
Yann Leboulanger pushed to branch master at gajim / gajim
Commits:
0244ac44 by Yann Leboulanger at 2017-08-13T15:51:36+02:00
fix norwegian translation
- - - - -
3 changed files:
- po/LINGUAS
- po/nb.po → po/nb_NO.po
- − po/no.po
Changes:
=====================================
po/LINGUAS
=====================================
--- a/po/LINGUAS
+++ b/po/LINGUAS
@@ -7,7 +7,7 @@ es
ru
bg
de
-nb
+nb_NO
cs
nl
pt_BR
@@ -15,7 +15,6 @@ sv
it
eu
sk
-no
zh_CN
br
eo
=====================================
po/nb.po → po/nb_NO.po
=====================================
=====================================
po/no.po deleted
=====================================
The diff for this file was not included because it is too large.
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/0244ac447514af869aa29deaa740fb75f4…
---
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/0244ac447514af869aa29deaa740fb75f4…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
27afece6 by Philipp Hörist at 2017-08-13T00:50:39+02:00
OptionsDialog: Center switch button vertically
- - - - -
1 changed file:
- gajim/dialogs.py
Changes:
=====================================
gajim/dialogs.py
=====================================
--- a/gajim/dialogs.py
+++ b/gajim/dialogs.py
@@ -3678,6 +3678,7 @@ class SwitchOption(Gtk.Grid):
self.switch.connect("notify::active", callback, *user_data)
self.switch.set_hexpand(True)
self.switch.set_halign(Gtk.Align.END)
+ self.switch.set_valign(Gtk.Align.CENTER)
self.add(label)
self.add(self.switch)
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/27afece67808eb6460bc970f125ae3f885…
---
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/27afece67808eb6460bc970f125ae3f885…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
5554e994 by Philipp Hörist at 2017-08-13T00:45:03+02:00
Add maximize button to XMLConsole window
- - - - -
1 changed file:
- gajim/dialogs.py
Changes:
=====================================
gajim/dialogs.py
=====================================
--- a/gajim/dialogs.py
+++ b/gajim/dialogs.py
@@ -3365,8 +3365,6 @@ class XMLConsoleWindow(Gtk.Window):
switch.connect("notify::active", self.on_enable)
headerbar.pack_start(switch)
- headerbar.set_decoration_layout(':minimize,close')
-
self.enabled = True
self.presence = True
self.message = True
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/5554e994524a1840e8b166958fa4adfc89…
---
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/5554e994524a1840e8b166958fa4adfc89…
You're receiving this email because of your account on dev.gajim.org.
Yann Leboulanger pushed to branch master at gajim / gajim
Commits:
43b3d1bd by Yann Leboulanger at 2017-08-12T22:55:17+02:00
unify cid -> candidate_id
- - - - -
3 changed files:
- gajim/common/jingle_ftstates.py
- gajim/common/jingle_transport.py
- gajim/common/socks5.py
Changes:
=====================================
gajim/common/jingle_ftstates.py
=====================================
--- a/gajim/common/jingle_ftstates.py
+++ b/gajim/common/jingle_ftstates.py
@@ -79,7 +79,7 @@ class StateCandSent(JingleFileTransferStates):
transport.setNamespace(nbxmpp.NS_JINGLE_BYTESTREAM)
transport.setAttr('sid', self.jft.transport.sid)
candidateused = nbxmpp.Node('candidate-used')
- candidateused.setAttr('cid', streamhost['cid'])
+ candidateused.setAttr('cid', streamhost['candidate_id'])
transport.addChild(node=candidateused)
content.addChild(node=transport)
self.jft.session.send_transport_info(content)
=====================================
gajim/common/jingle_transport.py
=====================================
--- a/gajim/common/jingle_transport.py
+++ b/gajim/common/jingle_transport.py
@@ -156,7 +156,7 @@ class JingleTransportSocks5(JingleTransport):
'target': self.ourjid,
'host': candidate['host'],
'port': int(candidate['port']),
- 'cid': candidate['cid'],
+ 'candidate_id': candidate['cid'],
'type': typ,
'priority': candidate['priority']
}
=====================================
gajim/common/socks5.py
=====================================
--- a/gajim/common/socks5.py
+++ b/gajim/common/socks5.py
@@ -133,13 +133,23 @@ class SocksQueue:
else:
fp = fingerprint
if receiving:
- log.debug('Trying to connect as receiver to cid ' + streamhost['cid'])
+ if 'candidate_id' in streamhost:
+ log.debug('Trying to connect as receiver to cid ' + \
+ streamhost['candidate_id'])
+ else:
+ log.debug('Trying to connect as receiver to jid ' + \
+ streamhost['jid'])
file_props.type_ = 'r'
socks5obj = Socks5ReceiverClient(self.idlequeue, streamhost,
sid, file_props, fingerprint=fp)
self.add_sockobj(account, socks5obj)
else:
- log.debug('Trying to connect as sender to cid' + streamhost['cid'])
+ if 'candidate_id' in streamhost:
+ log.debug('Trying to connect as sender to cid' + \
+ streamhost['candidate_id'])
+ else:
+ log.debug('Trying to connect as sender to jid' + \
+ streamhost['jid'])
if file_props.sha_str:
idx = file_props.sha_str
else:
@@ -166,7 +176,10 @@ class SocksQueue:
Called when there is a host connected to one of the senders's
streamhosts. Stop other attempts for connections
"""
- log.debug('Connected to cid ' + streamhost['cid'])
+ if 'candidate_id' in streamhost:
+ log.debug('Connected to cid ' + streamhost['candidate_id'])
+ else:
+ log.debug('Connected to jid ' + streamhost['jid'])
for host in file_props.streamhosts:
if host != streamhost and 'idx' in host:
if host['state'] == 1:
@@ -228,7 +241,10 @@ class SocksQueue:
"""
Called when we loose connection during transfer
"""
- log.debug('Connection refused to cid ' + streamhost['cid'])
+ if 'candidate_id' in streamhost:
+ log.debug('Connection refused to cid ' + streamhost['candidate_id'])
+ else:
+ log.debug('Connection refused to jid ' + streamhost['jid'])
if file_props is None:
return
streamhost['state'] = -1
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/43b3d1bd83538d3fe222c42d40295176da…
---
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/43b3d1bd83538d3fe222c42d40295176da…
You're receiving this email because of your account on dev.gajim.org.
Yann Leboulanger pushed to branch master at gajim / gajim
Commits:
1a2ac87f by Yann Leboulanger at 2017-08-11T08:11:52+02:00
use precis_i18n instead of stringprepare when available to sanitize JIDs
- - - - -
b6189a60 by Yann Leboulanger at 2017-08-11T08:12:00+02:00
use idna python module to check domainpart when available
- - - - -
d468a1d9 by Yann Leboulanger at 2017-08-11T08:12:00+02:00
update optional dependencies
- - - - -
baa54f50 by Yann Leboulanger at 2017-08-12T14:55:08+02:00
Merge branch 'use_precis' into 'master'
Use precis instead of stringprep when available. Fixes #8566
See merge request !116
- - - - -
2 changed files:
- README
- gajim/common/helpers.py
Changes:
=====================================
README
=====================================
--- a/README
+++ b/README
@@ -37,6 +37,7 @@
<li>gir1.2-farstream-0.2, gir1.2-gstreamer-1.0 and gir1.2-gst-plugins-base-1.0 for audio and video calls</li>
<li>gir1.2-gupnpigd-1.0 for better NAT traversing</li>
<li>gir1.2-networkmanager-1.0 for network lose detection</li>
+<li>python3-idna and python3-precis-i18n for correctly parsing JIDs</li>
</ul>
<p>Some distributions also split too much python standard library. I know SUSE does. In such distros you also need python-xml the xml lib that *comes* with python and not pyxml or whatever.</p>
=====================================
gajim/common/helpers.py
=====================================
--- a/gajim/common/helpers.py
+++ b/gajim/common/helpers.py
@@ -53,6 +53,18 @@ import nbxmpp
from common.i18n import Q_
from common.i18n import ngettext
+try:
+ import precis_i18n.codec
+ HAS_PRECIS_I18N = True
+except ImportError:
+ HAS_PRECIS_I18N = False
+
+try:
+ import idna
+ HAS_IDNA = True
+except ImportError:
+ HAS_IDNA = False
+
HAS_SOUND = True
if sys.platform == 'win32':
try:
@@ -244,8 +256,11 @@ def parse_resource(resource):
"""
if resource:
try:
- from nbxmpp.stringprepare import resourceprep
- return resourceprep.prepare(resource)
+ if HAS_PRECIS_I18N:
+ return resource.encode('Nickname').decode('utf-8')
+ else:
+ from nbxmpp.stringprepare import resourceprep
+ return resourceprep.prepare(resource)
except UnicodeError:
raise InvalidFormat('Invalid character in resource.')
@@ -274,33 +289,44 @@ def prep(user, server, resource):
if not ip_address:
if server is not None:
- if len(server) < 1 or len(server) > 1023:
- raise InvalidFormat(_('Server must be between 1 and 1023 chars'))
+ if server.endswith('.'): # RFC7622, 3.2
+ server = server[:-1]
+ if len(server) < 1 or len(server.encode('utf-8')) > 1023:
+ raise InvalidFormat(_('Server must be between 1 and 1023 bytes'))
try:
- from nbxmpp.stringprepare import nameprep
- server = nameprep.prepare(server)
+ if HAS_IDNA:
+ server = idna.encode(server).decode('utf-8')
+ else:
+ from nbxmpp.stringprepare import nameprep
+ server = nameprep.prepare(server)
except UnicodeError:
raise InvalidFormat(_('Invalid character in hostname.'))
else:
raise InvalidFormat(_('Server address required.'))
if user is not None:
- if len(user) < 1 or len(user) > 1023:
- raise InvalidFormat(_('Username must be between 1 and 1023 chars'))
+ if len(user) < 1 or len(user.encode('utf-8')) > 1023:
+ raise InvalidFormat(_('Username must be between 1 and 1023 bytes'))
try:
- from nbxmpp.stringprepare import nodeprep
- user = nodeprep.prepare(user)
+ if HAS_PRECIS_I18N:
+ user = user.encode('UsernameCaseMapped').decode('utf-8')
+ else:
+ from nbxmpp.stringprepare import nodeprep
+ user = nodeprep.prepare(user)
except UnicodeError:
raise InvalidFormat(_('Invalid character in username.'))
else:
user = None
if resource is not None:
- if len(resource) < 1 or len(resource) > 1023:
- raise InvalidFormat(_('Resource must be between 1 and 1023 chars'))
+ if len(resource) < 1 or len(resource.encode('utf-8')) > 1023:
+ raise InvalidFormat(_('Resource must be between 1 and 1023 bytes'))
try:
- from nbxmpp.stringprepare import resourceprep
- resource = resourceprep.prepare(resource)
+ if HAS_PRECIS_I18N:
+ resource = resource.encode('OpaqueString').decode('utf-8')
+ else:
+ from nbxmpp.stringprepare import resourceprep
+ resource = resourceprep.prepare(resource)
except UnicodeError:
raise InvalidFormat(_('Invalid character in resource.'))
else:
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/af547a1827a1fd8e8b408912426e68367…
---
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/af547a1827a1fd8e8b408912426e68367…
You're receiving this email because of your account on dev.gajim.org.