[Git][gajim/gajim][gajim_0.16] Add .gitignore

2016-12-17 Thread Philipp Hörist
Philipp Hörist pushed to branch gajim_0.16 at gajim / gajim


Commits:
50c3e947 by Philipp Hörist at 2016-12-18T00:35:41+01:00
Add .gitignore

- - - - -


1 changed file:

- .hgignore → .gitignore


Changes:

=
.hgignore → .gitignore
=
--- a/.hgignore
+++ b/.gitignore
@@ -1,5 +1,6 @@
 syntax: glob
 *.orig
+*.swp
 *.gmo
 *.in
 *.m4
@@ -15,6 +16,7 @@ po/POTFILES
 po/stamp-it
 stamp-h1
 Makefile
+__pycache__/
 
 syntax: regexp
 ^config\.*



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/commit/50c3e9476c2043bc8be217a8713f869b94365d1b
___
Commits mailing list
Commits@gajim.org
https://lists.gajim.org/cgi-bin/listinfo/commits


[Git][gajim/gajim][gajim_0.16] do not list all keys when we want to know if we have a key. Fixes #8477

2016-12-17 Thread Yann Leboulanger
Yann Leboulanger pushed to branch gajim_0.16 at gajim / gajim


Commits:
ed7a40cb by Yann Leboulanger at 2016-12-17T14:23:20+01:00
do not list all keys when we want to know if we have a key. Fixes #8477

Conflicts:
src/common/connection.py

- - - - -


3 changed files:

- src/common/connection.py
- src/common/gpg.py
- src/common/helpers.py


Changes:

=
src/common/connection.py
=
--- a/src/common/connection.py
+++ b/src/common/connection.py
@@ -692,8 +692,10 @@ class CommonConnection:
 else:
 self.gpg.passphrase = passphrase
 
-def ask_gpg_keys(self):
+def ask_gpg_keys(self, keyID=None):
 if self.gpg:
+if keyID:
+return self.gpg.get_key(keyID)
 return self.gpg.get_keys()
 return None
 
@@ -2153,7 +2155,7 @@ class Connection(CommonConnection, ConnectionHandlers):
 _cb_parameters={"jid":jid, "msg":msg, "keyID":keyID, 
"forward_from":forward_from,
 "session":session, "original_message":original_message, 
"subject":subject, "type_":type_,
 "msg_iq":msg_iq, "xhtml":xhtml, "obj":obj}))
-
+
 self._prepare_message(obj.jid, obj.message, obj.keyID, type_=obj.type_,
 subject=obj.subject, chatstate=obj.chatstate, msg_id=obj.msg_id,
 resource=obj.resource, user_nick=obj.user_nick, xhtml=obj.xhtml,
@@ -2166,7 +2168,7 @@ class Connection(CommonConnection, ConnectionHandlers):
 if obj.conn.name != self.name:
 return
 obj.msg_id = self.connection.send(obj.msg_iq, now=obj.now)
-
+
 # obj in this function is the obj as seen in _nec_message_outgoing()
 def cb(obj, jid, msg, keyID, forward_from, session, original_message,
 subject, type_, msg_iq, xhtml, msg_id):
@@ -2187,7 +2189,7 @@ class Connection(CommonConnection, ConnectionHandlers):
 else:
 self.log_message(jid, msg, forward_from, session,
 original_message, subject, type_, xhtml)
-
+
 cb(msg_id=obj.msg_id, **obj._cb_parameters)
 
 def send_contacts(self, contacts, fjid, type_='message'):


=
src/common/gpg.py
=
--- a/src/common/gpg.py
+++ b/src/common/gpg.py
@@ -114,6 +114,9 @@ if HAVE_GPG:
 
 return ''
 
+def get_key(self, keyID):
+return super(GnuPG, self).list_keys(keys=[keyID])
+
 def get_keys(self, secret=False):
 keys = {}
 result = super(GnuPG, self).list_keys(secret=secret)


=
src/common/helpers.py
=
--- a/src/common/helpers.py
+++ b/src/common/helpers.py
@@ -1314,9 +1314,9 @@ def prepare_and_validate_gpg_keyID(account, jid, keyID):
 # An unsigned presence, just use the assigned key
 keyID = attached_keys[attached_keys.index(jid) + 1]
 elif keyID:
-public_keys = gajim.connections[account].ask_gpg_keys()
+full_key = gajim.connections[account].ask_gpg_keys(keyID=keyID)
 # Assign the corresponding key, if we have it in our keyring
-if keyID in public_keys:
+if full_key:
 for u in gajim.contacts.get_contacts(account, jid):
 u.keyID = keyID
 keys_str = gajim.config.get_per('accounts', account,



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/commit/ed7a40cb47a9ddb8e21b91cc9707820e8c93e353
___
Commits mailing list
Commits@gajim.org
https://lists.gajim.org/cgi-bin/listinfo/commits


[Git][gajim/gajim][master] do not list all keys when we want to know if we have a key. Fixes #8477

2016-12-17 Thread Yann Leboulanger
Yann Leboulanger pushed to branch master at gajim / gajim


Commits:
458d1083 by Yann Leboulanger at 2016-12-17T14:06:36+01:00
do not list all keys when we want to know if we have a key. Fixes #8477

- - - - -


3 changed files:

- src/common/connection.py
- src/common/gpg.py
- src/common/helpers.py


Changes:

=
src/common/connection.py
=
--- a/src/common/connection.py
+++ b/src/common/connection.py
@@ -684,8 +684,10 @@ class CommonConnection:
 else:
 self.gpg.passphrase = passphrase
 
-def ask_gpg_keys(self):
+def ask_gpg_keys(self, keyID=None):
 if self.gpg:
+if keyID:
+return self.gpg.get_key(keyID)
 return self.gpg.get_keys()
 return None
 
@@ -2163,7 +2165,7 @@ class Connection(CommonConnection, ConnectionHandlers):
 _cb_parameters={"jid":jid, "msg":msg, "keyID":keyID, 
"forward_from":forward_from,
 "session":session, "original_message":original_message, 
"subject":subject, "type_":type_,
 "msg_iq":msg_iq, "xhtml":xhtml, "obj":obj}))
-
+
 self._prepare_message(obj.jid, obj.message, obj.keyID, type_=obj.type_,
 subject=obj.subject, chatstate=obj.chatstate, msg_id=obj.msg_id,
 resource=obj.resource, user_nick=obj.user_nick, xhtml=obj.xhtml,
@@ -2176,7 +2178,7 @@ class Connection(CommonConnection, ConnectionHandlers):
 if obj.conn.name != self.name:
 return
 obj.msg_id = self.connection.send(obj.msg_iq, now=obj.now)
-
+
 # obj in this function is the obj as seen in _nec_message_outgoing()
 def cb(obj, jid, msg, keyID, forward_from, session, original_message,
 subject, type_, msg_iq, xhtml, msg_id):
@@ -2197,7 +2199,7 @@ class Connection(CommonConnection, ConnectionHandlers):
 else:
 self.log_message(jid, msg, forward_from, session,
 original_message, subject, type_, xhtml, 
obj.additional_data)
-
+
 cb(msg_id=obj.msg_id, **obj._cb_parameters)
 
 def send_contacts(self, contacts, fjid, type_='message'):


=
src/common/gpg.py
=
--- a/src/common/gpg.py
+++ b/src/common/gpg.py
@@ -113,6 +113,9 @@ if HAVE_GPG:
 
 return ''
 
+def get_key(self, keyID):
+return super(GnuPG, self).list_keys(keys=[keyID])
+
 def get_keys(self, secret=False):
 keys = {}
 result = super(GnuPG, self).list_keys(secret=secret)


=
src/common/helpers.py
=
--- a/src/common/helpers.py
+++ b/src/common/helpers.py
@@ -1285,9 +1285,9 @@ def prepare_and_validate_gpg_keyID(account, jid, keyID):
 # An unsigned presence, just use the assigned key
 keyID = attached_keys[attached_keys.index(jid) + 1]
 elif keyID:
-public_keys = gajim.connections[account].ask_gpg_keys()
+full_key = gajim.connections[account].ask_gpg_keys(keyID=keyID)
 # Assign the corresponding key, if we have it in our keyring
-if keyID in public_keys:
+if full_key:
 for u in gajim.contacts.get_contacts(account, jid):
 u.keyID = keyID
 keys_str = gajim.config.get_per('accounts', account,



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/commit/458d1083bc34c76ff30ee9037041d26fd9ae4764
___
Commits mailing list
Commits@gajim.org
https://lists.gajim.org/cgi-bin/listinfo/commits


[Git][gajim/gajim][master] correctly check if python-gnupg is installed

2016-12-17 Thread Yann Leboulanger
Yann Leboulanger pushed to branch master at gajim / gajim


Commits:
58341e97 by Yann Leboulanger at 2016-12-17T13:31:37+01:00
correctly check if python-gnupg is installed

- - - - -


1 changed file:

- src/common/gajim.py


Changes:

=
src/common/gajim.py
=
--- a/src/common/gajim.py
+++ b/src/common/gajim.py
@@ -162,7 +162,7 @@ except ImportError:
 HAVE_GPG = True
 GPG_BINARY = 'gpg'
 try:
-__import__('gnupg', globals(), locals(), [], 0)
+__import__('gnupg')
 except ImportError:
 HAVE_GPG = False
 else:



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/commit/58341e9742d384eb6c76b258b5f2cd9feeb7d343
___
Commits mailing list
Commits@gajim.org
https://lists.gajim.org/cgi-bin/listinfo/commits


[Git][gajim/gajim][master] don't crash when gnupg doesn't have a status attribute.

2016-12-17 Thread Yann Leboulanger
Yann Leboulanger pushed to branch master at gajim / gajim


Commits:
d9efb31b by Yann Leboulanger at 2016-12-17T13:32:35+01:00
dont crash when gnupg doesnt have a status attribute.

- - - - -


1 changed file:

- src/common/gpg.py


Changes:

=
src/common/gpg.py
=
--- a/src/common/gpg.py
+++ b/src/common/gpg.py
@@ -89,7 +89,7 @@ if HAVE_GPG:
 
 if result.fingerprint:
 return self._stripHeaderFooter(str(result))
-if result.status == 'key expired':
+if hasattr(result, 'status') and result.status == 'key expired':
 return 'KEYEXPIRED'
 return 'BAD_PASSPHRASE'
 



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/commit/d9efb31b2ec7b821a8636925b20db772558f1b3a
___
Commits mailing list
Commits@gajim.org
https://lists.gajim.org/cgi-bin/listinfo/commits