Philipp Hörist pushed to branch master at gajim / gajim
Commits:
7e0e4cce by Philipp Hörist at 2017-08-07T19:28:54+02:00
PluginManager: remove plugin path from sys.path
Remove plugin path from sys.path after importing.
If we scan multiple plugin dirs and never remove the path from
sys.path, it is hard to predict from which path python will import
a package.
The chance that the same plugin package is in multiple plugin paths
is high.
- - - - -
635ce528 by Philipp Hörist at 2017-08-07T20:02:03+02:00
PluginManager: prefer plugins in user path
As we always load plugins from the user path first, we should not
reload them later from Gajims plugin base dir
- - - - -
1 changed file:
- gajim/plugins/pluginmanager.py
Changes:
=====================================
gajim/plugins/pluginmanager.py
=====================================
--- a/gajim/plugins/pluginmanager.py
+++ b/gajim/plugins/pluginmanager.py
@@ -531,6 +531,11 @@ class PluginManager(metaclass=Singleton):
try:
if module_name in sys.modules:
+ if path == gajim.PLUGINS_DIRS[0]:
+ # Only reload plugins from Gajim base dir when they
+ # dont exist. This means plugins in the user path are
+ # always preferred.
+ continue
from imp import reload
log.info('Reloading %s', module_name)
module = reload(sys.modules[module_name])
@@ -589,6 +594,7 @@ class PluginManager(metaclass=Singleton):
log.debug('%s : %s' % (module_attr_name,
'wrong manifest file. section are required!'))
+ sys.path.remove(path)
return plugins_found
def install_from_zip(self, zip_filename, owerwrite=None):
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/413c7f52d7123248cbb9b2cce1f4ec99a…
---
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/413c7f52d7123248cbb9b2cce1f4ec99a…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
413c7f52 by Philipp Hörist at 2017-08-07T17:41:32+02:00
Add senders attr to Jingle FT
This is a MUST see https://xmpp.org/extensions/xep-0234.html
Fixes #8662
- - - - -
5 changed files:
- gajim/common/jingle.py
- gajim/common/jingle_content.py
- gajim/common/jingle_ft.py
- gajim/common/jingle_session.py
- gajim/gui_interface.py
Changes:
=====================================
gajim/common/jingle.py
=====================================
--- a/gajim/common/jingle.py
+++ b/gajim/common/jingle.py
@@ -163,9 +163,14 @@ class ConnectionJingle(object):
transport = JingleTransportSocks5()
elif contact.supports(nbxmpp.NS_JINGLE_IBB):
transport = JingleTransportIBB()
+
+ senders = 'initiator'
+ if request:
+ senders = 'responder'
c = JingleFileTransfer(jingle, transport=transport,
file_props=file_props,
- use_security=use_security)
+ use_security=use_security,
+ senders=senders)
file_props.algo = self.__hash_support(contact)
jingle.add_content('file' + helpers.get_random_string_16(), c)
jingle.start_session()
=====================================
gajim/common/jingle_content.py
=====================================
--- a/gajim/common/jingle_content.py
+++ b/gajim/common/jingle_content.py
@@ -42,7 +42,7 @@ class JingleContent:
An abstraction of content in Jingle sessions
"""
- def __init__(self, session, transport):
+ def __init__(self, session, transport, senders):
self.session = session
self.transport = transport
# will be filled by JingleSession.add_content()
@@ -56,7 +56,10 @@ class JingleContent:
self.media = None
- self.senders = 'both' #FIXME
+ self.senders = senders
+ if self.senders is None:
+ self.senders = 'both'
+
self.allow_sending = True # Used for stream direction, attribute 'senders'
# These were found by the Politie
@@ -138,7 +141,9 @@ class JingleContent:
if payload is None:
payload = []
return nbxmpp.Node('content',
- attrs={'name': self.name, 'creator': self.creator},
+ attrs={'name': self.name,
+ 'creator': self.creator,
+ 'senders': self.senders},
payload=payload)
def send_candidate(self, candidate):
=====================================
gajim/common/jingle_ft.py
=====================================
--- a/gajim/common/jingle_ft.py
+++ b/gajim/common/jingle_ft.py
@@ -58,8 +58,8 @@ class State(IntEnum):
class JingleFileTransfer(JingleContent):
def __init__(self, session, transport=None, file_props=None,
- use_security=False):
- JingleContent.__init__(self, session, transport)
+ use_security=False, senders=None):
+ JingleContent.__init__(self, session, transport, senders)
log.info("transport value: %s", transport)
# events we might be interested in
self.callbacks['session-initiate'] += [self.__on_session_initiate]
=====================================
gajim/common/jingle_session.py
=====================================
--- a/gajim/common/jingle_session.py
+++ b/gajim/common/jingle_session.py
@@ -526,7 +526,7 @@ class JingleSession:
contents, contents_rejected, reason_txt = self.__parse_contents(jingle)
# If we are not receivin a file
# Check if there's already a session with this user:
- if contents[0][0] != 'file':
+ if contents[0].media != 'file':
for session in self.connection.iter_jingle_sessions(self.peerjid):
if session is not self:
reason = nbxmpp.Node('reason')
@@ -538,8 +538,7 @@ class JingleSession:
else:
# Stop if we don't have the requested file or the peer is not
# allowed to request the file
- request = \
- jingle.getTag('content').getTag('description').getTag('request')
+ request = contents[0].senders == 'responder'
if request:
self.request = True
hash_tag = request.getTag('file').getTag('hash')
@@ -568,7 +567,7 @@ class JingleSession:
gajim.nec.push_incoming_event(JingleRequestReceivedEvent(None,
conn=self.connection,
jingle_session=self,
- contents=contents))
+ contents=contents[0]))
def __broadcast(self, stanza, jingle, error, action):
"""
@@ -624,6 +623,7 @@ class JingleSession:
contents_rejected = []
reasons = set()
for element in jingle.iterTags('content'):
+ senders = element.getAttr('senders')
transport = get_jingle_transport(element.getTag('transport'))
if transport:
transport.ourjid = self.ourjid
@@ -631,10 +631,11 @@ class JingleSession:
if content_type:
try:
if transport:
- content = content_type(self, transport)
+ content = content_type(
+ self, transport=transport, senders=senders)
self.add_content(element['name'],
content, 'peer')
- contents.append((content.media,))
+ contents.append(content)
else:
reasons.add('unsupported-transports')
contents_rejected.append((element['name'], 'peer'))
@@ -711,12 +712,12 @@ class JingleSession:
@staticmethod
def __append_content(jingle, content):
"""
- Append <content/> element to <jingle/> element, with (full=True) or
- without (full=False) <content/> children
+ Append <content/> element to <jingle/> element
"""
jingle.addChild('content',
attrs={'name': content.name,
- 'creator': content.creator})
+ 'creator': content.creator,
+ 'senders': content.senders})
def __append_contents(self, jingle):
"""
=====================================
gajim/gui_interface.py
=====================================
--- a/gajim/gui_interface.py
+++ b/gajim/gui_interface.py
@@ -1225,7 +1225,7 @@ class Interface:
# TODO: conditional blocking if peer is not in roster
account = obj.conn.name
- content_types = set(c[0] for c in obj.contents)
+ content_types = obj.contents.media
# check type of jingle session
if 'audio' in content_types or 'video' in content_types:
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/413c7f52d7123248cbb9b2cce1f4ec99a1…
---
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/413c7f52d7123248cbb9b2cce1f4ec99a1…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
a0161117 by Philipp Hörist at 2017-08-02T21:32:59+02:00
Logger: dont try to parse None with json
- - - - -
1 changed file:
- gajim/common/logger.py
Changes:
=====================================
gajim/common/logger.py
=====================================
--- a/gajim/common/logger.py
+++ b/gajim/common/logger.py
@@ -135,8 +135,9 @@ class Logger:
Row = namedtuple("Row", fields)
named_row = Row(*row)
if 'additional_data' in fields:
- named_row = named_row._replace(
- additional_data=json.loads(named_row.additional_data))
+ if named_row.additional_data is not None:
+ named_row = named_row._replace(
+ additional_data=json.loads(named_row.additional_data))
return named_row
def dispatch(self, event, error):
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/a01611178d01758af3dd75b7abffb93721…
---
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/a01611178d01758af3dd75b7abffb93721…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
0c6002b9 by Philipp Hörist at 2017-08-02T21:03:12+02:00
Zeroconf: handle only zeroconf messages
- - - - -
1 changed file:
- gajim/common/zeroconf/connection_zeroconf.py
Changes:
=====================================
gajim/common/zeroconf/connection_zeroconf.py
=====================================
--- a/gajim/common/zeroconf/connection_zeroconf.py
+++ b/gajim/common/zeroconf/connection_zeroconf.py
@@ -333,6 +333,8 @@ class ConnectionZeroconf(CommonConnection, ConnectionHandlersZeroconf):
msg=_('Please check if avahi-daemon is running.')))
def _nec_stanza_message_outgoing(self, obj):
+ if obj.conn.name != self.name:
+ return
def on_send_ok(stanza_id):
gajim.nec.push_incoming_event(MessageSentEvent(None, conn=self,
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/0c6002b9ac749116bf0cbf7ddc6777b3ac…
---
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/0c6002b9ac749116bf0cbf7ddc6777b3ac…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
e2d61012 by Philipp Hörist at 2017-08-02T20:13:35+02:00
Windows Build: compile GLib schemas
- - - - -
1 changed file:
- win/_base.sh
Changes:
=====================================
win/_base.sh
=====================================
--- a/win/_base.sh
+++ b/win/_base.sh
@@ -112,6 +112,9 @@ pillow
"${MINGW_ROOT}"/bin/gtk-update-icon-cache-3.0.exe --force \
"${MINGW_ROOT}/share/icons/Adwaita"
+ # Compile GLib schemas
+ "${MINGW_ROOT}"/bin/glib-compile-schemas.exe "${MINGW_ROOT}"/share/glib-2.0/schemas
+
}
function install_gajim {
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/e2d61012c69235395826dd5976788af6e8…
---
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/e2d61012c69235395826dd5976788af6e8…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
97f6b84b by Philipp Hörist at 2017-08-02T19:24:09+02:00
Remove old unused code
- - - - -
2 changed files:
- gajim/common/contacts.py
- gajim/session.py
Changes:
=====================================
gajim/common/contacts.py
=====================================
--- a/gajim/common/contacts.py
+++ b/gajim/common/contacts.py
@@ -94,7 +94,7 @@ class Contact(CommonContact):
"""
def __init__(self, jid, account, name='', groups=None, show='', status='',
sub='', ask='', resource='', priority=0, keyID='', client_caps=None,
- our_chatstate=None, chatstate=None, idle_time=None, msg_log_id=None):
+ our_chatstate=None, chatstate=None, idle_time=None):
if not isinstance(jid, str):
print('no str')
if groups is None:
@@ -111,7 +111,6 @@ class Contact(CommonContact):
self.priority = priority
self.keyID = keyID
- self.msg_log_id = msg_log_id
self.idle_time = idle_time
self.pep = {}
=====================================
gajim/session.py
=====================================
--- a/gajim/session.py
+++ b/gajim/session.py
@@ -129,8 +129,6 @@ class ChatControlSession(stanza_session.EncryptedStanzaSession):
# Brand new message, incoming.
contact.our_chatstate = obj.chatstate
contact.chatstate = obj.chatstate
- if obj.msg_log_id: # Do not overwrite an existing msg_log_id with None
- contact.msg_log_id = obj.msg_log_id
# THIS MUST BE AFTER chatstates handling
# AND BEFORE playsound (else we hear sounding on chatstates!)
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/97f6b84b908d85cf4d9de074d8ea359897…
---
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/97f6b84b908d85cf4d9de074d8ea359897…
You're receiving this email because of your account on dev.gajim.org.