...
 
Commits (3)
......@@ -30,7 +30,7 @@ First, Thanks for that! Here is how to do that:
**Before you put in any work, please contact us on gajim@conference.gajim.org**
**Dont use dev.gajim.org for any projects that are not directly for the benefit of Gajim**
**Don't use dev.gajim.org for any projects that are not directly for the benefit of Gajim**
## Plugins list
* [AntiSpamPlugin](https://dev.gajim.org/gajim/gajim-plugins/wikis/AntiSpamPlugin) Block some incoming messages
......
......@@ -2,7 +2,7 @@
"""
Appindicator integration plugin.
Rewriten from Ubuntu Ayatana Integration plugin
Rewritten from Ubuntu Ayatana Integration plugin
2013 Denis Borenko <borenko@rambler.ru>
2017 Philipp Hörist <philipp@hoerist.com>
:license: GPLv3
......
......@@ -108,7 +108,7 @@ class Base(object):
if event.type == Gdk.EventType.BUTTON_PRESS and event.button.button == 1:
# left mouse button clicked
begin_iter = iter_.copy()
# we get the begining of the tag
# we get the beginning of the tag
while not begin_iter.begins_tag(texttag):
begin_iter.backward_char()
end_iter = iter_.copy()
......
......@@ -204,7 +204,7 @@ class ClientsIconsPlugin(GajimPlugin):
client_name = _('Unknown')
caps_ = None
if caps:
# libpurple returns pidgin.im/ only, we have to look for ressource name
# libpurple returns pidgin.im/ only, we have to look for resource name
if 'pidgin.im/' in caps:
caps = 'libpurple'
for client in LIBPURPLE_CLIENTS:
......@@ -443,7 +443,7 @@ class ClientsIconsPlugin(GajimPlugin):
self.set_icon(roster.model, iter_, self.renderer_num, None, contact)
return
# higest contact changed
# highest contact changed
if roster.model[iter_][self.renderer_num] is not None:
caps = contact.client_caps._node
if caps:
......
......@@ -270,7 +270,7 @@ class Base(object):
if event.type == Gdk.EventType.BUTTON_PRESS and event.button.button == 3:
# show popup menu (right mouse button clicked)
begin_iter = iter_.copy()
# we get the begining of the tag
# we get the beginning of the tag
while not begin_iter.begins_tag(texttag):
begin_iter.backward_char()
end_iter = iter_.copy()
......@@ -286,27 +286,27 @@ class Base(object):
nick = self.juick_nick_re.search(word)
if post is None and nick is None:
return
childs = self.juick_link_menu.get_children()
children = self.juick_link_menu.get_children()
if post:
self.juick_post_full = app.interface.sharp_slash_re\
.search(word).group(0)
self.juick_post_uid = post.group(1)
for menuitem in range(7):
childs[menuitem].show()
children[menuitem].show()
for menuitem in range(7, 13):
childs[menuitem].hide()
children[menuitem].hide()
if nick:
self.juick_nick = nick.group(0)
for menuitem in range(7):
childs[menuitem].hide()
children[menuitem].hide()
for menuitem in range(7, 13):
childs[menuitem].show()
children[menuitem].show()
self.juick_link_menu.popup(None, None, None, None,
event.button.button, event.time)
if event.type == Gdk.EventType.BUTTON_PRESS and event.button.button == 1:
# insert message num or nick (left mouse button clicked)
begin_iter = iter_.copy()
# we get the begining of the tag
# we get the beginning of the tag
while not begin_iter.begins_tag(texttag):
begin_iter.backward_char()
end_iter = iter_.copy()
......
......@@ -3,7 +3,7 @@
<requires lib="gtk+" version="2.16"/>
<!-- interface-naming-policy toplevel-contextual -->
<object class="GtkTextBuffer" id="textbuffer1">
<property name="text">Plug-in decription should be displayed here. This text will be erased during PluginsWindow initialization.</property>
<property name="text">Plug-in description should be displayed here. This text will be erased during PluginsWindow initialization.</property>
</object>
<object class="GtkWindow" id="window1">
<child>
......
......@@ -61,7 +61,7 @@
- Query only the most recent PEP items
2.3.6 / 2017-08-21
- Adapt to Gaim beeing now a Package
- Adapt to Gaim being now a Package
2.3.5 / 2017-08-07
- Support 12bit IVs on httpupload files
......@@ -104,7 +104,7 @@
- Fix a bug when publishing devices
- Fix copying fingerprint
- Fix layout issue
- Dont handle type 'normal' messages
- Don't handle type 'normal' messages
2.0.1 / 2017-01-14
- Better XEP Compliance
......
......@@ -25,7 +25,7 @@ from cryptography.hazmat.primitives.ciphers import algorithms
from cryptography.hazmat.primitives.ciphers.modes import GCM
# On Windows we have to import a specific backend because the
# default_backend() mechanism doesnt work in Gajim for Windows.
# default_backend() mechanism doesn't work in Gajim for Windows.
# Its because of how Gajim is build with cx_freeze
if os.name == 'nt':
......
......@@ -33,7 +33,7 @@ class SQLDatabase():
c.execute("PRAGMA synchronous=NORMAL;")
c.execute("PRAGMA journal_mode;")
mode = c.fetchone()[0]
# WAL is a persistent DB mode, dont override it if user has set it
# WAL is a persistent DB mode, don't override it if user has set it
if mode != 'wal':
c.execute("PRAGMA journal_mode=MEMORY;")
self.dbConn.commit()
......@@ -93,7 +93,7 @@ class SQLDatabase():
""" Migrates the DB
"""
# Find all double entrys and delete them
# Find all double entries and delete them
if user_version(self.dbConn) < 2:
delete_dupes = """ DELETE FROM identities WHERE _id not in (
SELECT MIN(_id)
......
......@@ -281,10 +281,6 @@ class OmemoState:
devices_list = self.device_list_for(jid, True)
if len(devices_list) == 0:
log.error('No known devices')
return
payload, tag = encrypt(key, iv, plaintext)
key += tag
......@@ -315,10 +311,6 @@ class OmemoState:
log.warning('Failed to find key for device ' +
str(rid))
encrypted_jids.append(jid_to)
if len(encrypted_keys) == 0:
log_msg = 'Encrypted keys empty'
log.error(log_msg)
raise NoValidSessions(log_msg)
my_other_devices = set(self.own_devices) - set({self.own_device_id})
# Encrypt the message key with for each of our own devices
......@@ -336,6 +328,10 @@ class OmemoState:
log.exception('ERROR:')
log.warning('Failed to find key for device ' + str(dev))
if not encrypted_keys:
log.error('Encrypted keys empty')
raise NoValidSessions('Encrypted keys empty')
result = {'sid': self.own_device_id,
'keys': encrypted_keys,
'jid': jid,
......
......@@ -94,6 +94,7 @@ class OMEMOConnection:
data_dir = configpaths.get('MY_DATA')
db_path = os.path.join(data_dir, 'omemo_' + self.own_jid + '.db')
conn = sqlite3.connect(db_path, check_same_thread=False)
conn.execute("PRAGMA secure_delete=1")
return OmemoState(self.own_jid, conn, self.account, self)
def signed_in(self, event):
......@@ -274,8 +275,8 @@ class OMEMOConnection:
from_jid = self.omemo.store. \
getJidFromDevice(msg_dict['sid'])
if not from_jid:
log.error('%s => Cant decrypt GroupChat Message '
'from %s', self.account, msg.resource)
log.error("%s => Can't decrypt GroupChat Message "
"from %s", self.account, msg.resource)
msg.encrypted = 'drop'
return
self.groupchat[msg.jid][msg.resource] = from_jid
......@@ -288,7 +289,7 @@ class OMEMOConnection:
plaintext = self.gc_message[msg_dict['payload']]
del self.gc_message[msg_dict['payload']]
else:
log.error('%s => Cant decrypt own GroupChat Message',
log.error("%s => Can't decrypt own GroupChat Message",
self.account)
msg.encrypted = 'drop'
return
......@@ -483,9 +484,9 @@ class OMEMOConnection:
'namespace': NS_OMEMO})
event.msg_iq.addChild(node=eme_node)
# Add Message for devices that dont support OMEMO
support_msg = _('You received a message encrypted with ' \
'OMEMO but your client doesnt support OMEMO.')
# Add Message for devices that don't support OMEMO
support_msg = _("You received a message encrypted with " \
"OMEMO but your client doesn't support OMEMO.")
event.msg_iq.setBody(support_msg)
# Store Hint for MAM
......@@ -587,7 +588,7 @@ class OMEMOConnection:
self._handle_device_list_update(None, event.stanza)
# Dont propagate event further
# Don't propagate event further
return True
def _handle_device_list_update(self, conn, stanza, fetch_bundle=False):
......@@ -674,7 +675,7 @@ class OMEMOConnection:
self.account, stanza.getError())
def are_keys_missing(self, contact_jid):
""" Checks if devicekeys are missing and querys the
""" Checks if devicekeys are missing and queries the
bundles
Parameters
......
......@@ -37,8 +37,8 @@ from omemo.xmpp import DevicelistPEP
CRYPTOGRAPHY_MISSING = 'You are missing Python-Cryptography'
AXOLOTL_MISSING = 'You are missing Python-Axolotl or use an outdated version'
PROTOBUF_MISSING = 'OMEMO cant import Google Protobuf, you can find help in ' \
'the GitHub Wiki'
PROTOBUF_MISSING = "OMEMO can't import Google Protobuf, you can find help in " \
"the GitHub Wiki"
ERROR_MSG = ''
......@@ -236,11 +236,8 @@ class OmemoPlugin(GajimPlugin):
if isinstance(chat_control, GroupchatControl):
room = chat_control.room_jid
missing = True
own_jid = app.get_jid_from_account(account)
for nick in con.groupchat[room]:
real_jid = con.groupchat[room][nick]
if real_jid == own_jid:
continue
if not con.are_keys_missing(real_jid):
missing = False
if missing:
......
......@@ -18,7 +18,7 @@
#
""" This module handles all the XMPP logic like creating different kind of
stanza nodes and geting data from stanzas.
stanza nodes and getting data from stanzas.
"""
import logging
......
......@@ -253,7 +253,7 @@ class OldPGPPlugin(GajimPlugin):
'namespace': nbxmpp.NS_ENCRYPTED})
obj.msg_iq.addChild(node=eme_node)
# Set xhtml to None so it doesnt get logged
# Set xhtml to None so it doesn't get logged
obj.xhtml = None
obj.encrypted = self.encryption_name
print_msg_to_log(obj.msg_iq)
......
......@@ -316,15 +316,15 @@ class TriggersPluginConfigDialog(GajimPluginConfigDialog):
self.config[int(n)] = self.plugin.config[n]
# Contains status checkboxes
childs = self.status_hbox.get_children()
self.all_status_rb = childs[0]
self.special_status_rb = childs[1]
self.online_cb = childs[2]
self.away_cb = childs[3]
self.xa_cb = childs[4]
self.dnd_cb = childs[5]
self.invisible_cb = childs[6]
children = self.status_hbox.get_children()
self.all_status_rb = children[0]
self.special_status_rb = children[1]
self.online_cb = children[2]
self.away_cb = children[3]
self.xa_cb = children[4]
self.dnd_cb = children[5]
self.invisible_cb = children[6]
if not self.conditions_treeview.get_column(0):
# window never opened
......
......@@ -424,7 +424,7 @@ class JingleWhiteboard(JingleContent):
self.session.connection.connection.send(message)
def send_items(self, items, rids):
# recieves dict items and a list of rids of items to send
# receives dict items and a list of rids of items to send
# TODO: is there a less clumsy way that doesn't involve passing
# whole list
self.send_whiteboard_node(items, rids)
......
......@@ -127,7 +127,7 @@ class Whiteboard(object):
self.item_data = None
# Will be {ID: {type:'element', data:[node, goocanvas]}, ID2: {}} instance
self.recieving = {}
self.receiving = {}
def on_tool_button_toggled(self, widget):
for btn in self.tool_buttons:
......@@ -281,25 +281,25 @@ class Whiteboard(object):
def recieve_element(self, element):
node = self.image.g.addChild(name=element.getAttr('name'))
self.image.g.addChild(node=node)
self.recieving[element.getAttr('rid')] = {'type':'element',
self.receiving[element.getAttr('rid')] = {'type':'element',
'data':[node],
'children':[]}
def recieve_attr(self, element):
node = self.recieving[element.getAttr('parent')]['data'][0]
node = self.receiving[element.getAttr('parent')]['data'][0]
node.setAttr(element.getAttr('name'), element.getAttr('chdata'))
self.recieving[element.getAttr('rid')] = {'type':'attr',
self.receiving[element.getAttr('rid')] = {'type':'attr',
'data':element.getAttr('name'),
'parent':node}
self.recieving[element.getAttr('parent')]['children'].append(element.getAttr('rid'))
self.receiving[element.getAttr('parent')]['children'].append(element.getAttr('rid'))
def apply_new(self):
for x in self.recieving.keys():
if self.recieving[x]['type'] == 'element':
self.image.add_recieved(x, self.recieving)
for x in self.receiving.keys():
if self.receiving[x]['type'] == 'element':
self.image.add_recieved(x, self.receiving)
self.recieving = {}
self.receiving = {}
class SVGObject():
......