Philipp Hörist pushed to branch master at gajim / gajim
Commits:
eef27894 by Daniel Brötzmann at 2019-12-06T21:48:56Z
ChatControl: Make allow_shutdown more precise
On closing a control this checks if logs are enabled for the contact/account
and displays the appropriate message.
- - - - -
1 changed file:
- gajim/chat_control.py
Changes:
=====================================
gajim/chat_control.py
=====================================
@@ -1136,14 +1136,24 @@ class ChatControl(ChatControlBase):
def allow_shutdown(self, method, on_yes, on_no, _on_minimize):
time_ = app.last_message_time[self.account][self.get_full_jid()]
+ # 2 seconds
if time.time() - time_ < 2:
- # 2 seconds
+ no_log_for = app.config.get_per(
+ 'accounts', self.account, 'no_log_for').split()
+ more = ''
+ if self.contact.jid in no_log_for:
+ more = _('Note: Chat history is disabled for this contact.')
+ if self.account in no_log_for:
+ more = _('Note: Chat history is disabled for this account.')
+ text = _('You just received a new message from %s.\n'
+ 'Do you want to close this tab?') % self.contact.get_shown_name()
+ if more:
+ text += '\n' + more
+
NewConfirmationDialog(
_('Close'),
- _('You just received a new message '
- 'from %s') % self.contact.jid,
- _('If you close this tab while having chat history disabled, '
- 'this message will be lost.'),
+ _('New Message'),
+ text,
[DialogButton.make('Cancel',
callback=lambda: on_no(self)),
DialogButton.make('Remove',
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/eef27894bff0235be3598b3bd9c14ca6d6…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/eef27894bff0235be3598b3bd9c14ca6d6…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
ff61353d by Philipp Hörist at 2019-12-06T21:35:53Z
Refactor pubsub notification handlers
Adapt to nbxmpp changes
- - - - -
7 changed files:
- gajim/common/modules/bookmarks.py
- gajim/common/modules/user_activity.py
- gajim/common/modules/user_avatar.py
- gajim/common/modules/user_location.py
- gajim/common/modules/user_mood.py
- gajim/common/modules/user_nickname.py
- gajim/common/modules/user_tune.py
Changes:
=====================================
gajim/common/modules/bookmarks.py
=====================================
@@ -75,19 +75,8 @@ class Bookmarks(BaseModule):
return self._pubsub_support() and self.conversion_2
@event_node(nbxmpp.NS_BOOKMARKS)
- def _bookmark_event_received(self, _con, stanza, properties):
+ def _bookmark_event_received(self, _con, _stanza, properties):
if properties.pubsub_event.retracted:
- # Unsure how to handle that
- return
-
- bookmarks = properties.pubsub_event.data
- if properties.pubsub_event.deleted or properties.pubsub_event.purged:
- self._log.info('Bookmark node deleted')
- bookmarks = []
-
- elif properties.pubsub_event.data is None:
- self._log.warning('Invalid bookmark data')
- self._log.warning(stanza)
return
if not properties.is_self_message:
@@ -102,6 +91,10 @@ class Bookmarks(BaseModule):
self._log.info('Ignore update, pubsub request in progress')
return
+ bookmarks = properties.pubsub_event.data
+ if bookmarks is None:
+ bookmarks = []
+
old_bookmarks = self._convert_to_set(self._bookmarks)
self._bookmarks = bookmarks
self._act_on_changed_bookmarks(old_bookmarks)
@@ -109,7 +102,7 @@ class Bookmarks(BaseModule):
NetworkEvent('bookmarks-received', account=self._account))
@event_node(nbxmpp.NS_BOOKMARKS_2)
- def _bookmark_2_event_received(self, _con, stanza, properties):
+ def _bookmark_2_event_received(self, _con, _stanza, properties):
if not properties.is_self_message:
self._log.warning('%s has an open access bookmarks node',
properties.jid)
@@ -125,7 +118,7 @@ class Bookmarks(BaseModule):
old_bookmarks = self._convert_to_set(self._bookmarks)
if properties.pubsub_event.deleted or properties.pubsub_event.purged:
- self._log.info('Bookmark node deleted')
+ self._log.info('Bookmark node deleted/purged')
self._bookmarks = []
elif properties.pubsub_event.retracted:
@@ -138,11 +131,6 @@ class Bookmarks(BaseModule):
except KeyError:
pass
- elif properties.pubsub_event.data is None:
- self._log.warning('Invalid bookmark data')
- self._log.warning(stanza)
- return
-
else:
new_bookmark = properties.pubsub_event.data
old_bookmark = self.get_bookmark_from_jid(new_bookmark.jid)
=====================================
gajim/common/modules/user_activity.py
=====================================
@@ -40,18 +40,19 @@ class UserActivity(BaseModule):
@event_node(nbxmpp.NS_ACTIVITY)
def _activity_received(self, _con, _stanza, properties):
- data = properties.pubsub_event.data
- empty = properties.pubsub_event.empty
+ if properties.pubsub_event.retracted:
+ return
+ data = properties.pubsub_event.data
for contact in app.contacts.get_contacts(self._account,
str(properties.jid)):
- if not empty:
+ if data is not None:
contact.pep[PEPEventType.ACTIVITY] = data
else:
contact.pep.pop(PEPEventType.ACTIVITY, None)
if properties.is_self_message:
- if not empty:
+ if data is not None:
self._con.pep[PEPEventType.ACTIVITY] = data
else:
self._con.pep.pop(PEPEventType.ACTIVITY, None)
=====================================
gajim/common/modules/user_avatar.py
=====================================
@@ -35,12 +35,14 @@ class UserAvatar(BaseModule):
@event_node(nbxmpp.NS_AVATAR_METADATA)
def _avatar_metadata_received(self, _con, _stanza, properties):
+ if properties.pubsub_event.retracted:
+ return
+
data = properties.pubsub_event.data
- empty = properties.pubsub_event.empty
jid = str(properties.jid)
own_jid = self._con.get_own_jid().getBare()
- if empty:
+ if data is None:
# Remove avatar
self._log.info('Remove: %s', jid)
app.contacts.set_avatar(self._account, jid, None)
=====================================
gajim/common/modules/user_location.py
=====================================
@@ -37,18 +37,19 @@ class UserLocation(BaseModule):
@event_node(nbxmpp.NS_LOCATION)
def _location_received(self, _con, _stanza, properties):
- data = properties.pubsub_event.data
- empty = properties.pubsub_event.empty
+ if properties.pubsub_event.retracted:
+ return
+ data = properties.pubsub_event.data
for contact in app.contacts.get_contacts(self._account,
str(properties.jid)):
- if not empty:
+ if data is not None:
contact.pep[PEPEventType.LOCATION] = data
else:
contact.pep.pop(PEPEventType.LOCATION, None)
if properties.is_self_message:
- if not empty:
+ if data is not None:
self._con.pep[PEPEventType.LOCATION] = data
else:
self._con.pep.pop(PEPEventType.LOCATION, None)
=====================================
gajim/common/modules/user_mood.py
=====================================
@@ -40,18 +40,19 @@ class UserMood(BaseModule):
@event_node(nbxmpp.NS_MOOD)
def _mood_received(self, _con, _stanza, properties):
- data = properties.pubsub_event.data
- empty = properties.pubsub_event.empty
+ if properties.pubsub_event.retracted:
+ return
+ data = properties.pubsub_event.data
for contact in app.contacts.get_contacts(self._account,
str(properties.jid)):
- if not empty:
+ if data is not None:
contact.pep[PEPEventType.MOOD] = data
else:
contact.pep.pop(PEPEventType.MOOD, None)
if properties.is_self_message:
- if not empty:
+ if data is not None:
self._con.pep[PEPEventType.MOOD] = data
else:
self._con.pep.pop(PEPEventType.MOOD, None)
=====================================
gajim/common/modules/user_nickname.py
=====================================
@@ -38,6 +38,9 @@ class UserNickname(BaseModule):
@event_node(nbxmpp.NS_NICK)
def _nickname_received(self, _con, _stanza, properties):
+ if properties.pubsub_event.retracted:
+ return
+
nick = properties.pubsub_event.data
if properties.is_self_message:
if nick is None:
=====================================
gajim/common/modules/user_tune.py
=====================================
@@ -40,18 +40,19 @@ class UserTune(BaseModule):
@event_node(nbxmpp.NS_TUNE)
def _tune_received(self, _con, _stanza, properties):
- data = properties.pubsub_event.data
- empty = properties.pubsub_event.empty
+ if properties.pubsub_event.retracted:
+ return
+ data = properties.pubsub_event.data
for contact in app.contacts.get_contacts(self._account,
str(properties.jid)):
- if not empty:
+ if data is not None:
contact.pep[PEPEventType.TUNE] = data
else:
contact.pep.pop(PEPEventType.TUNE, None)
if properties.is_self_message:
- if not empty:
+ if data is not None:
self._con.pep[PEPEventType.TUNE] = data
else:
self._con.pep.pop(PEPEventType.TUNE, None)
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/ff61353d8d6d6b1a97d66db100da8a7eea…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/ff61353d8d6d6b1a97d66db100da8a7eea…
You're receiving this email because of your account on dev.gajim.org.
Yann Leboulanger pushed to branch master at gajim / gajim
Commits:
06f2b08f by Yann Leboulanger at 2019-12-06T08:25:49Z
there is no more core plugins. see [765180d1]
- - - - -
1 changed file:
- scripts/dev/plugins_translate
Changes:
=====================================
scripts/dev/plugins_translate
=====================================
@@ -14,13 +14,6 @@ check_args()
init_ln()
{
- if [ -e "core_plugins" ] && [ ! -L "core_plugins" ]; then
- echo "core_plugins must be a symbolic link" >&2
- exit 1
- fi
- if [ ! -e "core_plugins" ]; then
- ln -s ../../plugins core_plugins
- fi
if [ ! -L "community_plugins" ]; then
echo "community_plugins should be a symbolic link to gajim-plugins repository, else they won't be in po files"
fi
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/06f2b08f674702fdbacff23fab63197d83…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/06f2b08f674702fdbacff23fab63197d83…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
69770417 by Philipp Hörist at 2019-12-02T21:26:20Z
Pylint: Don't check for optional module
- - - - -
0b11fb4b by Philipp Hörist at 2019-12-02T21:27:32Z
Update pylintrc
pylint throws false positive no-member errors because the class is overridden
in pygobject and pylint seem not to pick up on this
- - - - -
713a95fb by Philipp Hörist at 2019-12-02T21:42:29Z
CI: Update pylint script
- - - - -
3 changed files:
- gajim/common/dbus/location.py
- pylintrc
- scripts/dev/pylint-ci.sh
Changes:
=====================================
gajim/common/dbus/location.py
=====================================
@@ -23,7 +23,7 @@ from nbxmpp.structs import LocationData
from gajim.common import app
if app.is_installed('GEOCLUE'):
- from gi.repository import Geoclue # pylint: disable=ungrouped-imports
+ from gi.repository import Geoclue # pylint: disable=ungrouped-imports,no-name-in-module
log = logging.getLogger('gajim.c.dbus.location')
=====================================
pylintrc
=====================================
@@ -140,7 +140,7 @@ ignore-mixin-members=yes
# List of class names for which member attributes should not be checked (useful
# for classes with dynamically set attributes). This supports the use of
# qualified names.
-ignored-classes=optparse.Values,thread._local,_thread._local
+ignored-classes=optparse.Values,thread._local,_thread._local,gi.repository.GLib.Error
# List of module names for which member attributes should not be checked
# (useful for modules/projects where namespaces are manipulated during runtime
=====================================
scripts/dev/pylint-ci.sh
=====================================
@@ -11,9 +11,10 @@ IGNORE_GTK_MODULE_ERRORS=C0103,C0301,C0330,C0415,E0401,E0611,E1101,E1133,E1136,R
"$PYLINT" --version
-"$PYLINT" --disable=$IGNORE_ERRORS --ignore=modules,gtk "$@"
+"$PYLINT" --disable=$IGNORE_ERRORS --ignore=modules,dbus,gtk "$@"
"$PYLINT" --disable=$IGNORE_GTK_MODULE_ERRORS "$@/gtk"
"$PYLINT" --disable=E0401,C0415 "$@/common/modules"
+"$PYLINT" "$@/common/dbus"
# C0103 invalid-name
# C0301 line-too-long
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/2499d4dc20bf30b1bc701b8962c4d8e6d…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/2499d4dc20bf30b1bc701b8962c4d8e6d…
You're receiving this email because of your account on dev.gajim.org.