Philipp Hörist pushed to branch master at gajim / gajim
Commits:
3b130db6 by Philipp Hörist at 2018-05-17T20:07:30+02:00
Simplify set_i18n_env()
We already determine LANG in initialize_lang()
getdefaultlocale() takes env var LANG into consideration
- - - - -
1 changed file:
- gajim/common/i18n.py
Changes:
=====================================
gajim/common/i18n.py
=====================================
--- a/gajim/common/i18n.py
+++ b/gajim/common/i18n.py
@@ -54,14 +54,7 @@ def initialize():
def set_i18n_env():
if os.name == 'nt':
- lang = os.getenv('LANG')
- if lang is None:
- default_lang = locale.getdefaultlocale()[0]
- if default_lang:
- lang = default_lang
-
- if lang:
- os.environ['LANG'] = lang
+ os.environ['LANG'] = LANG
def initialize_lang():
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/3b130db60c16694657629b93c2153e56f4…
---
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/3b130db60c16694657629b93c2153e56f4…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
40aa3d80 by Philipp Hörist at 2018-05-17T20:01:59+02:00
Remove unused comments
The attributes were removed in 8e09fd92
- - - - -
2a8c0da3 by Philipp Hörist at 2018-05-17T20:01:59+02:00
Use i18n module to determine locale
- - - - -
03aa1db3 by Philipp Hörist at 2018-05-17T20:01:59+02:00
Handle LC_ALL=C correctly
We default to 'en' for LANG if LC_ALL=C is set
- - - - -
2 changed files:
- gajim/common/connection.py
- gajim/common/i18n.py
Changes:
=====================================
gajim/common/connection.py
=====================================
--- a/gajim/common/connection.py
+++ b/gajim/common/connection.py
@@ -71,6 +71,7 @@ from gajim.common import app
from gajim.common import gpg
from gajim.common import passwords
from gajim.common import check_X509
+from gajim.common import i18n
from gajim.common.connection_handlers import *
from gajim.common.contacts import GC_Contact
from gajim.gtkgui_helpers import get_action
@@ -619,12 +620,7 @@ class Connection(CommonConnection, ConnectionHandlers):
def __init__(self, name):
CommonConnection.__init__(self, name)
ConnectionHandlers.__init__(self)
- # this property is used to prevent double connections
- # If we succeed to connect, remember it so next time we try (after a
- # disconnection) we try only this type.
- self.lang = None
- if locale.getdefaultlocale()[0]:
- self.lang = locale.getdefaultlocale()[0].split('_')[0]
+
# increase/decrease default timeout for server responses
self.try_connecting_for_foo_secs = 45
# holds the actual hostname to which we are connected
@@ -1522,8 +1518,7 @@ class Connection(CommonConnection, ConnectionHandlers):
# END connect
def add_lang(self, stanza):
- if self.lang:
- stanza.setAttr('xml:lang', self.lang)
+ stanza.setAttr('xml:lang', i18n.LANG)
def get_privacy_lists(self):
if not app.account_is_connected(self.name):
=====================================
gajim/common/i18n.py
=====================================
--- a/gajim/common/i18n.py
+++ b/gajim/common/i18n.py
@@ -68,7 +68,10 @@ def initialize_lang():
global LANG
try:
# en_US, fr_FR, el_GR etc..
- LANG = locale.getdefaultlocale()[0]
+ default = locale.getdefaultlocale()[0]
+ if default is None:
+ # LC_ALL=C
+ return
LANG = LANG[:2]
except (ValueError, locale.Error):
pass
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/4f29e2b353c2adec10c5754d56d8e0ba6…
---
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/4f29e2b353c2adec10c5754d56d8e0ba6…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
4f29e2b3 by Andrey Gursky at 2018-05-16T19:50:21+02:00
Preserve SSL handshake errors order
Sets are unordered and list with push/pop acts as LIFO, though we need FIFO.
Since the number of elements is tiny, no need to use deque.
Addresses #9120
- - - - -
1 changed file:
- gajim/common/connection.py
Changes:
=====================================
gajim/common/connection.py
=====================================
--- a/gajim/common/connection.py
+++ b/gajim/common/connection.py
@@ -1333,7 +1333,8 @@ class Connection(CommonConnection, ConnectionHandlers):
ssl_errors = con.Connection.ssl_errors
ignored_ssl_errors = self._get_ignored_ssl_errors()
- self._ssl_errors = set(ssl_errors) - set(ignored_ssl_errors)
+ self._ssl_errors = [n for n in ssl_errors if n not in ignored_ssl_errors]
+ self._ssl_errors.reverse()
self.process_ssl_errors()
def _get_ignored_ssl_errors(self):
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/4f29e2b353c2adec10c5754d56d8e0ba62…
---
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/4f29e2b353c2adec10c5754d56d8e0ba62…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
f13ff8ac by BBreeziN at 2018-05-15T23:39:44-04:00
Fix call to config.get_per() in method that gets account name from jid
- - - - -
1 changed file:
- gajim/common/app.py
Changes:
=====================================
gajim/common/app.py
=====================================
--- a/gajim/common/app.py
+++ b/gajim/common/app.py
@@ -484,7 +484,7 @@ def get_jid_from_account(account_name):
return jid
def get_account_from_jid(jid):
- for account in app.config.get_per('accounts'):
+ for account in config.get_per('accounts'):
if jid == get_jid_from_account(account):
return account
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/f13ff8ac68d8e2e015f35e750346acf70e…
---
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/f13ff8ac68d8e2e015f35e750346acf70e…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
3c22ab75 by Philipp Hörist at 2018-05-12T23:36:52+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
- - - - -
1 changed file:
- gajim/gui_interface.py
Changes:
=====================================
gajim/gui_interface.py
=====================================
--- a/gajim/gui_interface.py
+++ b/gajim/gui_interface.py
@@ -1664,7 +1664,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
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/3c22ab752ac64871f14b4b88297ee07539…
---
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/3c22ab752ac64871f14b4b88297ee07539…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
9e096e87 by Philipp Hörist at 2018-05-11T22:03:13+02:00
Add flake8 config file
- - - - -
1 changed file:
- + .flake8
Changes:
=====================================
.flake8
=====================================
--- /dev/null
+++ b/.flake8
@@ -0,0 +1,5 @@
+[flake8]
+ignore =
+exclude = .git,__pycache__,.gitlab
+max-complexity = 15
+builtins=_
\ No newline at end of file
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/9e096e87728365a9751f35fae7bc626cbf…
---
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/9e096e87728365a9751f35fae7bc626cbf…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
04b86a7b by Philipp Hörist at 2018-05-10T16:16:38+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
- - - - -
1 changed file:
- gajim/conversation_textview.py
Changes:
=====================================
gajim/conversation_textview.py
=====================================
--- a/gajim/conversation_textview.py
+++ b/gajim/conversation_textview.py
@@ -838,10 +838,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:
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/04b86a7bd0d0a99da3a05acc3723bfc8cd…
---
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/04b86a7bd0d0a99da3a05acc3723bfc8cd…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
ffe8ee80 by Philipp Hörist at 2018-05-10T13:28:26+02:00
Return account instead of jid
- - - - -
1 changed file:
- gajim/common/app.py
Changes:
=====================================
gajim/common/app.py
=====================================
--- a/gajim/common/app.py
+++ b/gajim/common/app.py
@@ -486,7 +486,7 @@ def get_jid_from_account(account_name):
def get_account_from_jid(jid):
for account in app.config.get_per('accounts'):
if jid == get_jid_from_account(account):
- return jid
+ return account
def get_our_jids():
"""
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/ffe8ee8068046f1b407884e892cbdab6bd…
---
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/ffe8ee8068046f1b407884e892cbdab6bd…
You're receiving this email because of your account on dev.gajim.org.