Use absolute imports on all plugins

This is necessary because Gajim is with 0.16.11 a python package
This commit is contained in:
Philipp Hörist
2017-07-17 01:42:50 +02:00
parent 507bf9a933
commit 9ce1c5b961
67 changed files with 451 additions and 452 deletions

View File

@@ -26,11 +26,11 @@ Block some incoming messages
from gi.repository import Gtk from gi.repository import Gtk
import nbxmpp import nbxmpp
from common import gajim, ged from gajim.common import app, ged
from plugins import GajimPlugin from gajim.plugins import GajimPlugin
from plugins.helpers import log, log_calls from gajim.plugins.helpers import log, log_calls
from plugins.gui import GajimPluginConfigDialog from gajim.plugins.gui import GajimPluginConfigDialog
class AntiSpamPlugin(GajimPlugin): class AntiSpamPlugin(GajimPlugin):
@@ -101,7 +101,7 @@ class AntiSpamPlugin(GajimPlugin):
@log_calls('AntiSpamPlugin') @log_calls('AntiSpamPlugin')
def _nec_subscribe_presence_received(self, obj): def _nec_subscribe_presence_received(self, obj):
if self.config['block_subscription_requests'] and \ if self.config['block_subscription_requests'] and \
not gajim.contacts.get_contacts(obj.conn.name, obj.jid): not app.contacts.get_contacts(obj.conn.name, obj.jid):
log.info('discarding subscription request from %s' % obj.jid) log.info('discarding subscription request from %s' % obj.jid)
return True return True
@@ -118,7 +118,7 @@ class AntiSpamPlugin(GajimPlugin):
if len(answer) == 0: if len(answer) == 0:
return False return False
block_conference = self.config['antispam_for_conference'] block_conference = self.config['antispam_for_conference']
is_conference = gajim.contacts.is_gc_contact(obj.conn.name, obj.fjid) is_conference = app.contacts.is_gc_contact(obj.conn.name, obj.fjid)
if not block_conference and is_conference: if not block_conference and is_conference:
return False return False
jid = obj.jid if not is_conference else obj.fjid jid = obj.jid if not is_conference else obj.fjid
@@ -127,7 +127,7 @@ class AntiSpamPlugin(GajimPlugin):
# There are two methods to see who wrote you and not passed filter: # There are two methods to see who wrote you and not passed filter:
# 1. Using XML console # 1. Using XML console
# 2. Running Gajim with log info messages and see logs (probably gajim.log file) # 2. Running Gajim with log info messages and see logs (probably gajim.log file)
if is_conference or not gajim.contacts.get_contacts(obj.conn.name, jid): if is_conference or not app.contacts.get_contacts(obj.conn.name, jid):
if not self.contain_answer(obj.msgtxt, answer): if not self.contain_answer(obj.msgtxt, answer):
if is_conference and jid in self.config['conference_white_list']: if is_conference and jid in self.config['conference_white_list']:
return False return False
@@ -164,7 +164,7 @@ class AntiSpamPlugin(GajimPlugin):
receipt.setTag('received', namespace='urn:xmpp:receipts', attrs={'id': obj.id_}) receipt.setTag('received', namespace='urn:xmpp:receipts', attrs={'id': obj.id_})
if obj.thread_id: if obj.thread_id:
receipt.setThread(obj.thread_id) receipt.setThread(obj.thread_id)
gajim.connections[obj.conn.name].connection.send(receipt, now=True) app.connections[obj.conn.name].connection.send(receipt, now=True)
question = self.config['msgtxt_question'] question = self.config['msgtxt_question']
log.info('Anti_spam enabled for %s, question: %s', jid, question) log.info('Anti_spam enabled for %s, question: %s', jid, question)
message = _('Antispam enabled. Please answer the question. The message must only ' + \ message = _('Antispam enabled. Please answer the question. The message must only ' + \
@@ -176,7 +176,7 @@ class AntiSpamPlugin(GajimPlugin):
else: # for 'normal' type else: # for 'normal' type
stanza = nbxmpp.Message(to=jid, body=message, subject='Antispam enabled', typ=obj.mtype) stanza = nbxmpp.Message(to=jid, body=message, subject='Antispam enabled', typ=obj.mtype)
gajim.connections[obj.conn.name].connection.send(stanza, now=True) app.connections[obj.conn.name].connection.send(stanza, now=True)
def contain_answer(self, msg, answer): def contain_answer(self, msg, answer):
return answer in msg.split('\n') return answer in msg.split('\n')

View File

@@ -1,10 +1,10 @@
[info] [info]
name: Anti Spam name: Anti Spam
short_name: anti_spam short_name: anti_spam
version: 1.4.3 version: 1.4.4
description: Block some incoming messages. description: Block some incoming messages.
authors = Yann Leboulanger <asterix@lagaule.org> authors = Yann Leboulanger <asterix@lagaule.org>
Denis Fomin <fominde@gmail.com> Denis Fomin <fominde@gmail.com>
Ilya Kanyukov <ilya.kanukov@gmail.com> Ilya Kanyukov <ilya.kanukov@gmail.com>
homepage = https://dev.gajim.org/gajim/gajim-plugins/wikis/AntiSpamPlugin homepage = https://dev.gajim.org/gajim/gajim-plugins/wikis/AntiSpamPlugin
min_gajim_version: 0.16.10 min_gajim_version: 0.16.11

View File

@@ -1,8 +1,8 @@
[info] [info]
name: Banner Tweaks name: Banner Tweaks
short_name: banner_tweaks short_name: banner_tweaks
version: 0.1.2 version: 0.1.3
description: Allows user to tweak chat window banner appearance (eg. make it compact). description: Allows user to tweak chat window banner appearance (eg. make it compact).
authors = Mateusz Biliński <mateusz@bilinski.it> authors = Mateusz Biliński <mateusz@bilinski.it>
homepage = http://trac-plugins.gajim.org/wiki/BannerTweaksPlugin homepage = http://trac-plugins.gajim.org/wiki/BannerTweaksPlugin
min_gajim_version: 0.16.10 min_gajim_version: 0.16.11

View File

@@ -33,13 +33,13 @@ import sys
from gi.repository import Gtk from gi.repository import Gtk
from gi.repository import GObject from gi.repository import GObject
import message_control from gajim import message_control
from common import gajim from gajim.common import app
from common import helpers from gajim.common import helpers
from plugins import GajimPlugin from gajim.plugins import GajimPlugin
from plugins.helpers import log, log_calls from gajim.plugins.helpers import log, log_calls
from plugins.gui import GajimPluginConfigDialog from gajim.plugins.gui import GajimPluginConfigDialog
class BannerTweaksPlugin(GajimPlugin): class BannerTweaksPlugin(GajimPlugin):
@@ -67,13 +67,13 @@ class BannerTweaksPlugin(GajimPlugin):
@log_calls('BannerTweaksPlugin') @log_calls('BannerTweaksPlugin')
def activate(self): def activate(self):
self.config['old_chat_avatar_height'] = gajim.config.get( self.config['old_chat_avatar_height'] = app.config.get(
'chat_avatar_height') 'chat_avatar_height')
#gajim.config.set('chat_avatar_height', 28) #gajim.config.set('chat_avatar_height', 28)
@log_calls('BannerTweaksPlugin') @log_calls('BannerTweaksPlugin')
def deactivate(self): def deactivate(self):
gajim.config.set('chat_avatar_height', self.config[ app.config.set('chat_avatar_height', self.config[
'old_chat_avatar_height']) 'old_chat_avatar_height'])
@log_calls('BannerTweaksPlugin') @log_calls('BannerTweaksPlugin')
@@ -122,14 +122,14 @@ class BannerTweaksPlugin(GajimPlugin):
# except if we are talking to two different resources of the same # except if we are talking to two different resources of the same
# contact # contact
acct_info = '' acct_info = ''
for account in gajim.contacts.get_accounts(): for account in app.contacts.get_accounts():
if account == chat_control.account: if account == chat_control.account:
continue continue
if acct_info: # We already found a contact with same nick if acct_info: # We already found a contact with same nick
break break
for jid in gajim.contacts.get_jid_list(account): for jid in app.contacts.get_jid_list(account):
other_contact_ = \ other_contact_ = \
gajim.contacts.get_first_contact_from_jid(account, jid) app.contacts.get_first_contact_from_jid(account, jid)
if other_contact_.get_shown_name() == \ if other_contact_.get_shown_name() == \
chat_control.contact.get_shown_name(): chat_control.contact.get_shown_name():
acct_info = ' (%s)' % \ acct_info = ' (%s)' % \
@@ -140,7 +140,7 @@ class BannerTweaksPlugin(GajimPlugin):
if self.config['banner_small_fonts']: if self.config['banner_small_fonts']:
font_attrs = font_attrs_small font_attrs = font_attrs_small
st = gajim.config.get('displayed_chat_state_notifications') st = app.config.get('displayed_chat_state_notifications')
cs = contact.chatstate cs = contact.chatstate
if cs and st in ('composing_only', 'all'): if cs and st in ('composing_only', 'all'):
if contact.show == 'offline': if contact.show == 'offline':

View File

@@ -1,7 +1,8 @@
[info] [info]
name: Birthday reminder name: Birthday reminder
short_name: birthday_reminder short_name: birthday_reminder
version: 0.0.3 version: 0.0.4
description: Birthday reminder plugin. Reminder before 5,3,1 and birthday days. description: Birthday reminder plugin. Reminder before 5,3,1 and birthday days.
authors: Evgeniy Popov <evgeniypopov@gmail.com> authors: Evgeniy Popov <evgeniypopov@gmail.com>
homepage: http://trac-plugins.gajim.org/wiki/BirthdayReminderPlugin homepage: http://trac-plugins.gajim.org/wiki/BirthdayReminderPlugin
min_gajim_version: 0.16.11

View File

@@ -4,13 +4,13 @@ import datetime
from xml.dom.minidom import * from xml.dom.minidom import *
from gi.repository import GObject from gi.repository import GObject
from plugins import GajimPlugin from gajim.plugins import GajimPlugin
from plugins.helpers import log_calls from gajim.plugins.helpers import log_calls
from notify import popup from gajim.notify import popup
from common import configpaths from gajim.common import configpaths
from common import gajim from gajim.common import app
from common import ged from gajim.common import ged
class BirthDayPlugin(GajimPlugin): class BirthDayPlugin(GajimPlugin):
@@ -30,8 +30,8 @@ class BirthDayPlugin(GajimPlugin):
def check_birthdays(self, account=None): def check_birthdays(self, account=None):
def show_popup(account, jid): def show_popup(account, jid):
contact_instances = gajim.contacts.get_contacts(account, jid) contact_instances = app.contacts.get_contacts(account, jid)
contact = gajim.contacts.get_highest_prio_contact_from_contacts( contact = app.contacts.get_highest_prio_contact_from_contacts(
contact_instances) contact_instances)
if contact: if contact:
nick = GObject.markup_escape_text(contact.get_shown_name()) nick = GObject.markup_escape_text(contact.get_shown_name())
@@ -44,7 +44,7 @@ class BirthDayPlugin(GajimPlugin):
popup('Send message', contact.jid, account, msg_type='', \ popup('Send message', contact.jid, account, msg_type='', \
path_to_image=image, title=title, text=text + ' ' + nick) path_to_image=image, title=title, text=text + ' ' + nick)
accounts = gajim.contacts.get_accounts() accounts = app.contacts.get_accounts()
vcards = [] vcards = []
date_dict = {} date_dict = {}
for jid in glob.glob(self.vcard_path + '*@*'): for jid in glob.glob(self.vcard_path + '*@*'):

View File

@@ -3,12 +3,12 @@
from gi.repository import GObject from gi.repository import GObject
from plugins import GajimPlugin from gajim.plugins import GajimPlugin
from plugins.helpers import log_calls from gajim.plugins.helpers import log_calls
from common import ged from gajim.common import ged
from common import gajim from gajim.common import app
from common import helpers from gajim.common import helpers
import gtkgui_helpers from gajim import gtkgui_helpers
import unicodedata import unicodedata
def paragraph_direction_mark(text): def paragraph_direction_mark(text):
@@ -44,7 +44,7 @@ class ChatstatePlugin(GajimPlugin):
if not self.active: if not self.active:
return return
contact = gajim.contacts.get_contact_from_full_jid(obj.conn.name, contact = app.contacts.get_contact_from_full_jid(obj.conn.name,
obj.fjid) obj.fjid)
if not contact: if not contact:
return return
@@ -53,12 +53,12 @@ class ChatstatePlugin(GajimPlugin):
if chatstate not in self.chatstates.keys(): if chatstate not in self.chatstates.keys():
return return
self.model = gajim.interface.roster.model self.model = app.interface.roster.model
child_iters = gajim.interface.roster._get_contact_iter(obj.jid, child_iters = app.interface.roster._get_contact_iter(obj.jid,
obj.conn.name, contact, self.model) obj.conn.name, contact, self.model)
name = GObject.markup_escape_text(contact.get_shown_name()) name = GObject.markup_escape_text(contact.get_shown_name())
contact_instances = gajim.contacts.get_contacts(obj.conn.name, contact_instances = app.contacts.get_contacts(obj.conn.name,
contact.jid) contact.jid)
# Show resource counter # Show resource counter
@@ -74,7 +74,7 @@ class ChatstatePlugin(GajimPlugin):
if chatstate != 'gone': if chatstate != 'gone':
color = self.chatstates[chatstate] color = self.chatstates[chatstate]
name = '<span foreground="%s">%s</span>' % (color, name) name = '<span foreground="%s">%s</span>' % (color, name)
if contact.status and gajim.config.get( if contact.status and app.config.get(
'show_status_msgs_in_roster'): 'show_status_msgs_in_roster'):
status = contact.status.strip() status = contact.status.strip()
if status != '': if status != '':
@@ -87,17 +87,17 @@ class ChatstatePlugin(GajimPlugin):
@log_calls('ChatstatePlugin') @log_calls('ChatstatePlugin')
def activate(self): def activate(self):
color = gtkgui_helpers.get_fade_color(gajim.interface.roster.tree, color = gtkgui_helpers.get_fade_color(app.interface.roster.tree,
False, False) False, False)
self.status_color = '#%04x%04x%04x' % (color.red, color.green, self.status_color = '#%04x%04x%04x' % (color.red, color.green,
color.blue) color.blue)
theme = gajim.config.get('roster_theme') theme = app.config.get('roster_theme')
self.chatstates = {'active': gajim.config.get('inmsgcolor'), self.chatstates = {'active': app.config.get('inmsgcolor'),
'composing': gajim.config.get_per('themes', theme, 'composing': app.config.get_per('themes', theme,
'state_composing_color'), 'state_composing_color'),
'inactive': gajim.config.get_per('themes', theme, 'inactive': app.config.get_per('themes', theme,
'state_inactive_color'), 'state_inactive_color'),
'paused': gajim.config.get_per('themes', theme, 'paused': app.config.get_per('themes', theme,
'state_paused_color'), 'state_paused_color'),
'gone': None, } 'gone': None, }
self.active = True self.active = True

View File

@@ -1,10 +1,10 @@
[info] [info]
name: Chatstate in roster name: Chatstate in roster
short_name: chatstate short_name: chatstate
version: 0.5.2 version: 0.5.3
description: Chat State Notifications in roster. description: Chat State Notifications in roster.
Font color of the contact varies depending on the chat state. Font color of the contact varies depending on the chat state.
The plugin does not work if you use custom font color for contacts in roster. The plugin does not work if you use custom font color for contacts in roster.
authors = Denis Fomin <fominde@gmail.com> authors = Denis Fomin <fominde@gmail.com>
homepage = http://trac-plugins.gajim.org/wiki/ChatstatePlugin homepage = http://trac-plugins.gajim.org/wiki/ChatstatePlugin
min_gajim_version: 0.16.10 min_gajim_version: 0.16.11

View File

@@ -3,9 +3,9 @@
from gi.repository import Gtk from gi.repository import Gtk
from gi.repository import Gdk from gi.repository import Gdk
from common import gajim from gajim.common import app
from plugins import GajimPlugin from gajim.plugins import GajimPlugin
from plugins.helpers import log_calls from gajim.plugins.helpers import log_calls
class ClickableNicknames(GajimPlugin): class ClickableNicknames(GajimPlugin):
@@ -23,7 +23,7 @@ class ClickableNicknames(GajimPlugin):
self.gc_controls = {} self.gc_controls = {}
self.tag_names = [] self.tag_names = []
colors = gajim.config.get('gc_nicknames_colors') colors = app.config.get('gc_nicknames_colors')
colors = colors.split(':') colors = colors.split(':')
for i, color in enumerate(colors): for i, color in enumerate(colors):
tagname = 'gc_nickname_color_' + str(i) tagname = 'gc_nickname_color_' + str(i)
@@ -31,7 +31,7 @@ class ClickableNicknames(GajimPlugin):
@log_calls('ClickableNicknamesPlugin') @log_calls('ClickableNicknamesPlugin')
def activate(self): def activate(self):
for gc_control in gajim.interface.msg_win_mgr.get_controls('gc'): for gc_control in app.interface.msg_win_mgr.get_controls('gc'):
# TODO support minimized groupchat # TODO support minimized groupchat
if gc_control not in self.gc_controls.keys(): if gc_control not in self.gc_controls.keys():
control = Base(self, gc_control) control = Base(self, gc_control)
@@ -118,18 +118,18 @@ class Base(object):
end_iter.forward_char() end_iter.forward_char()
buffer_ = self.textview.tv.get_buffer() buffer_ = self.textview.tv.get_buffer()
word = buffer_.get_text(begin_iter, end_iter, True) word = buffer_.get_text(begin_iter, end_iter, True)
nick = word.rstrip().rstrip(gajim.config.get('after_nickname')) nick = word.rstrip().rstrip(app.config.get('after_nickname'))
if nick.startswith('* '): if nick.startswith('* '):
nick = nick.lstrip('* ').split(' ')[0] nick = nick.lstrip('* ').split(' ')[0]
nick = nick.lstrip(gajim.config.get('before_nickname')) nick = nick.lstrip(app.config.get('before_nickname'))
nicks = gajim.contacts.get_nick_list(self.chat_control.account, nicks = app.contacts.get_nick_list(self.chat_control.account,
self.chat_control.room_jid) self.chat_control.room_jid)
if nick[1:] not in nicks: if nick[1:] not in nicks:
return return
message_buffer = self.chat_control.msg_textview.get_buffer() message_buffer = self.chat_control.msg_textview.get_buffer()
if message_buffer.get_char_count() < 1: if message_buffer.get_char_count() < 1:
nick = nick + gajim.config.get('gc_refer_to_nick_char') nick = nick + app.config.get('gc_refer_to_nick_char')
else: else:
start, end = message_buffer.get_bounds() start, end = message_buffer.get_bounds()
if message_buffer.get_text(start, end, True)[-1] != ' ': if message_buffer.get_text(start, end, True)[-1] != ' ':

View File

@@ -1,9 +1,9 @@
[info] [info]
name: Clickable Nicknames name: Clickable Nicknames
short_name: clickable_nicknames short_name: clickable_nicknames
version: 0.3 version: 0.4
description: Clickable nicknames in the conversation textview. description: Clickable nicknames in the conversation textview.
authors: Andrey Musikhin <melomansegfault@gmail.com> authors: Andrey Musikhin <melomansegfault@gmail.com>
Denis Fomin <fominde@gmail.com> Denis Fomin <fominde@gmail.com>
homepage: http://trac-plugins.gajim.org/wiki/ClickableNicknamesPlugin homepage: http://trac-plugins.gajim.org/wiki/ClickableNicknamesPlugin
min_gajim_version: 0.16.10 min_gajim_version: 0.16.11

View File

@@ -5,12 +5,12 @@ from gi.repository import Gtk
from gi.repository import GdkPixbuf from gi.repository import GdkPixbuf
import os import os
from plugins.gui import GajimPluginConfigDialog from gajim.plugins.gui import GajimPluginConfigDialog
from plugins import GajimPlugin from gajim.plugins import GajimPlugin
from plugins.helpers import log_calls from gajim.plugins.helpers import log_calls
from common import ged from gajim.common import ged
from common import gajim from gajim.common import app
import cell_renderer_image import gajim.cell_renderer_image
clients = { clients = {
'http://gajim.org': ['gajim.png', 'Gajim'], 'http://gajim.org': ['gajim.png', 'Gajim'],
@@ -230,7 +230,7 @@ class ClientsIconsPlugin(GajimPlugin):
vcard_table): vcard_table):
if not self.config['show_in_tooltip']: if not self.config['show_in_tooltip']:
return return
if len(contacts) == 1 and contacts[0].jid in gajim.get_our_jids(): if len(contacts) == 1 and contacts[0].jid in app.get_our_jids():
return return
if contacts[0].is_groupchat(): if contacts[0].is_groupchat():
return return
@@ -386,9 +386,9 @@ class ClientsIconsPlugin(GajimPlugin):
chat_control.model.set_sort_column_id(1, Gtk.SortType.ASCENDING) chat_control.model.set_sort_column_id(1, Gtk.SortType.ASCENDING)
chat_control.list_treeview.set_model(chat_control.model) chat_control.list_treeview.set_model(chat_control.model)
# draw roster # draw roster
for nick in gajim.contacts.get_nick_list(chat_control.account, for nick in app.contacts.get_nick_list(chat_control.account,
chat_control.room_jid): chat_control.room_jid):
gc_contact = gajim.contacts.get_gc_contact(chat_control.account, gc_contact = app.contacts.get_gc_contact(chat_control.account,
chat_control.room_jid, nick) chat_control.room_jid, nick)
iter_ = chat_control.add_contact_to_roster(nick, gc_contact.show, iter_ = chat_control.add_contact_to_roster(nick, gc_contact.show,
gc_contact.role, gc_contact.affiliation, gc_contact.status, gc_contact.role, gc_contact.affiliation, gc_contact.status,
@@ -430,7 +430,7 @@ class ClientsIconsPlugin(GajimPlugin):
@log_calls('ClientsIconsPlugin') @log_calls('ClientsIconsPlugin')
def activate(self): def activate(self):
self.active = None self.active = None
roster = gajim.interface.roster roster = app.interface.roster
col = Gtk.TreeViewColumn() col = Gtk.TreeViewColumn()
roster.nb_ext_renderers += 1 roster.nb_ext_renderers += 1
self.renderer_num = 10 + roster.nb_ext_renderers self.renderer_num = 10 + roster.nb_ext_renderers
@@ -459,7 +459,7 @@ class ClientsIconsPlugin(GajimPlugin):
@log_calls('ClientsIconsPlugin') @log_calls('ClientsIconsPlugin')
def deactivate(self): def deactivate(self):
self.active = None self.active = None
roster = gajim.interface.roster roster = app.interface.roster
roster.nb_ext_renderers -= 1 roster.nb_ext_renderers -= 1
col = roster.tree.get_column(0) col = roster.tree.get_column(0)
roster.tree.remove_column(col) roster.tree.remove_column(col)
@@ -477,8 +477,8 @@ class ClientsIconsPlugin(GajimPlugin):
def presence_received(self, iq_obj): def presence_received(self, iq_obj):
if not self.config['show_in_roster']: if not self.config['show_in_roster']:
return return
roster = gajim.interface.roster roster = app.interface.roster
contact = gajim.contacts.get_contact_with_highest_priority( contact = app.contacts.get_contact_with_highest_priority(
iq_obj.conn.name, iq_obj.jid) iq_obj.conn.name, iq_obj.jid)
if not contact: if not contact:
return return
@@ -525,7 +525,7 @@ class ClientsIconsPlugin(GajimPlugin):
def gc_presence_received(self, iq_obj): def gc_presence_received(self, iq_obj):
if not self.config['show_in_groupchats']: if not self.config['show_in_groupchats']:
return return
contact = gajim.contacts.get_gc_contact(iq_obj.conn.name, contact = app.contacts.get_gc_contact(iq_obj.conn.name,
iq_obj.presence_obj.jid, iq_obj.nick) iq_obj.presence_obj.jid, iq_obj.nick)
if not contact: if not contact:
return return
@@ -575,12 +575,12 @@ class ClientsIconsPlugin(GajimPlugin):
elif model[iter_][self.muc_renderer_num]: elif model[iter_][self.muc_renderer_num]:
renderer.set_property('visible', True) renderer.set_property('visible', True)
contact = gajim.contacts.get_gc_contact(control.account, contact = app.contacts.get_gc_contact(control.account,
control.room_jid, model[iter_][1]) control.room_jid, model[iter_][1])
if not contact: if not contact:
return return
bgcolor = gajim.config.get_per('themes', gajim.config.get( bgcolor = app.config.get_per('themes', app.config.get(
'roster_theme'), 'contactbgcolor') 'roster_theme'), 'contactbgcolor')
if bgcolor: if bgcolor:
renderer.set_property('cell-background', bgcolor) renderer.set_property('cell-background', bgcolor)
@@ -631,9 +631,9 @@ class ClientsIconsPluginConfigDialog(GajimPluginConfigDialog):
def redraw_all(self): def redraw_all(self):
self.plugin.deactivate() self.plugin.deactivate()
self.plugin.activate() self.plugin.activate()
for gc_control in gajim.interface.msg_win_mgr.get_controls('gc'): for gc_control in app.interface.msg_win_mgr.get_controls('gc'):
self.plugin.disconnect_from_groupchat_control(gc_control) self.plugin.disconnect_from_groupchat_control(gc_control)
for gc_control in gajim.interface.msg_win_mgr.get_controls('gc'): for gc_control in app.interface.msg_win_mgr.get_controls('gc'):
self.plugin.connect_with_groupchat_control(gc_control) self.plugin.connect_with_groupchat_control(gc_control)
def on_show_in_roster_toggled(self, widget): def on_show_in_roster_toggled(self, widget):
@@ -646,9 +646,9 @@ class ClientsIconsPluginConfigDialog(GajimPluginConfigDialog):
def on_show_in_groupchats_toggled(self, widget): def on_show_in_groupchats_toggled(self, widget):
self.plugin.config['show_in_groupchats'] = widget.get_active() self.plugin.config['show_in_groupchats'] = widget.get_active()
for gc_control in gajim.interface.msg_win_mgr.get_controls('gc'): for gc_control in app.interface.msg_win_mgr.get_controls('gc'):
self.plugin.disconnect_from_groupchat_control(gc_control) self.plugin.disconnect_from_groupchat_control(gc_control)
for gc_control in gajim.interface.msg_win_mgr.get_controls('gc'): for gc_control in app.interface.msg_win_mgr.get_controls('gc'):
self.plugin.connect_with_groupchat_control(gc_control) self.plugin.connect_with_groupchat_control(gc_control)
def on_show_unknown_icon_toggled(self, widget): def on_show_unknown_icon_toggled(self, widget):

View File

@@ -1,11 +1,11 @@
[info] [info]
name: Clients icons name: Clients icons
short_name: clients_icons short_name: clients_icons
version: 4.6 version: 4.7
description: Shows the client icons in the roster description: Shows the client icons in the roster
and in groupchats. and in groupchats.
For icons in tooltip support, you need to install Gajim r14117 or above. For icons in tooltip support, you need to install Gajim r14117 or above.
authors: Denis Fomin <fominde@gmail.com> authors: Denis Fomin <fominde@gmail.com>
Artem Klyop <art.klyop@gmail.com> Artem Klyop <art.klyop@gmail.com>
homepage: http://trac-plugins.gajim.org/wiki/ClientsIconsPlugin homepage: http://trac-plugins.gajim.org/wiki/ClientsIconsPlugin
min_gajim_version: 0.16.10.0 min_gajim_version: 0.16.11

View File

@@ -26,18 +26,18 @@ import queue
import nbxmpp import nbxmpp
import dialogs from gajim import dialogs
import gtkgui_helpers from gajim import gtkgui_helpers
from common import gajim from gajim.common import app
from common.connection_handlers_events import ( from gajim.common.connection_handlers_events import (
FailedDecryptEvent, MamMessageReceivedEvent) FailedDecryptEvent, MamMessageReceivedEvent)
from plugins import GajimPlugin from gajim.plugins import GajimPlugin
log = logging.getLogger('gajim.plugin_system.esessions') log = logging.getLogger('gajim.plugin_system.esessions')
ERROR_MSG = '' ERROR_MSG = ''
if not gajim.HAVE_PYCRYPTO: if not app.HAVE_PYCRYPTO:
ERROR_MSG = 'Please install pycrypto' ERROR_MSG = 'Please install pycrypto'
@@ -120,7 +120,7 @@ class ESessionsPlugin(GajimPlugin):
# Esessions cant decrypt Carbon Copys # Esessions cant decrypt Carbon Copys
return return
if obj.stanza.getTag('feature', namespace=nbxmpp.NS_FEATURE): if obj.stanza.getTag('feature', namespace=nbxmpp.NS_FEATURE):
if gajim.HAVE_PYCRYPTO: if app.HAVE_PYCRYPTO:
feature = obj.stanza.getTag(name='feature', feature = obj.stanza.getTag(name='feature',
namespace=nbxmpp.NS_FEATURE) namespace=nbxmpp.NS_FEATURE)
form = nbxmpp.DataForm(node=feature.getTag('x')) form = nbxmpp.DataForm(node=feature.getTag('x'))
@@ -158,7 +158,7 @@ class ESessionsPlugin(GajimPlugin):
obj.encrypted = 'ESessions' obj.encrypted = 'ESessions'
callback(obj) callback(obj)
except Exception: except Exception:
gajim.nec.push_incoming_event( app.nec.push_incoming_event(
FailedDecryptEvent(None, conn=conn, msg_obj=obj)) FailedDecryptEvent(None, conn=conn, msg_obj=obj))
return return

View File

@@ -1,8 +1,8 @@
[info] [info]
name: ESessions name: ESessions
short_name: esessions short_name: esessions
version: 1.0.0 version: 1.1.0
description: Encryption as per XEP-0200 description: Encryption as per XEP-0200
authors: Philipp Hörist <philipp@hoerist.com> authors: Philipp Hörist <philipp@hoerist.com>
homepage: https://dev.gajim.org/gajim/gajim-plugins/wikis/esessions homepage: https://dev.gajim.org/gajim/gajim-plugins/wikis/esessions
min_gajim_version: 0.16.10 min_gajim_version: 0.16.11

View File

@@ -1,5 +1,5 @@
import sqlite3 import sqlite3
from common import gajim from common import app
import sys import sys
import os import os
@@ -115,7 +115,7 @@ class FilesharingDatabase:
>>> _delete_file(1) >>> _delete_file(1)
""" """
self._check_duplicate(account, requester, file_) self._check_duplicate(account, requester, file_)
requester = gajim.get_jid_without_resource(requester) requester = app.get_jid_without_resource(requester)
c = self.conn.cursor() c = self.conn.cursor()
c.execute("INSERT INTO files (file_path, " + c.execute("INSERT INTO files (file_path, " +
"relative_path, hash_sha1, size, description, mod_date, " + "relative_path, hash_sha1, size, description, mod_date, " +

View File

@@ -4,10 +4,10 @@ from gi.repository import Gtk
from gi.repository import GObject from gi.repository import GObject
import subprocess import subprocess
from common import gajim from gajim.common import app
from plugins import GajimPlugin from gajim.plugins import GajimPlugin
from plugins.helpers import log_calls, log from gajim.plugins.helpers import log_calls, log
from plugins.gui import GajimPluginConfigDialog from gajim.plugins.gui import GajimPluginConfigDialog
class FlashingKeyboard(GajimPlugin): class FlashingKeyboard(GajimPlugin):
@@ -34,7 +34,7 @@ class FlashingKeyboard(GajimPlugin):
self.flash_trigger() self.flash_trigger()
def flash_trigger(self): def flash_trigger(self):
if gajim.events.get_nb_systray_events(): if app.events.get_nb_systray_events():
if self.id_0: if self.id_0:
return return
if self.config['flash']: if self.config['flash']:
@@ -60,9 +60,9 @@ class FlashingKeyboard(GajimPlugin):
@log_calls('FlashingKeyboard') @log_calls('FlashingKeyboard')
def activate(self): def activate(self):
gajim.events.event_added_subscribe(self.on_event_added) app.events.event_added_subscribe(self.on_event_added)
gajim.events.event_removed_subscribe(self.on_event_removed) app.events.event_removed_subscribe(self.on_event_removed)
if gajim.events.get_nb_systray_events(): if app.events.get_nb_systray_events():
if self.config['flash']: if self.config['flash']:
self.id_0 = GObject.timeout_add(self.timeout, self.led_on) self.id_0 = GObject.timeout_add(self.timeout, self.led_on)
else: else:
@@ -71,8 +71,8 @@ class FlashingKeyboard(GajimPlugin):
@log_calls('FlashingKeyboard') @log_calls('FlashingKeyboard')
def deactivate(self): def deactivate(self):
gajim.events.event_added_unsubscribe(self.on_event_added) app.events.event_added_unsubscribe(self.on_event_added)
gajim.events.event_removed_unsubscribe(self.on_event_removed) app.events.event_removed_unsubscribe(self.on_event_removed)
if self.id_0: if self.id_0:
GObject.source_remove(self.id_0) GObject.source_remove(self.id_0)
self.led_off() self.led_off()
@@ -93,7 +93,7 @@ class FlashingKeyboardPluginConfigDialog(GajimPluginConfigDialog):
def on_run(self): def on_run(self):
self.isactive = self.plugin.active self.isactive = self.plugin.active
if self.plugin.active: if self.plugin.active:
gajim.plugin_manager.deactivate_plugin(self.plugin) app.plugin_manager.deactivate_plugin(self.plugin)
for name in ('command1', 'command2'): for name in ('command1', 'command2'):
widget = self.xml.get_object(name) widget = self.xml.get_object(name)
widget.set_text(self.plugin.config[name]) widget.set_text(self.plugin.config[name])
@@ -108,5 +108,5 @@ class FlashingKeyboardPluginConfigDialog(GajimPluginConfigDialog):
widget = self.xml.get_object('flash_cb') widget = self.xml.get_object('flash_cb')
self.plugin.config['flash'] = not widget.get_active() self.plugin.config['flash'] = not widget.get_active()
if self.isactive: if self.isactive:
gajim.plugin_manager.activate_plugin(self.plugin) app.plugin_manager.activate_plugin(self.plugin)
GajimPluginConfigDialog.on_close_button_clicked(self, widget) GajimPluginConfigDialog.on_close_button_clicked(self, widget)

View File

@@ -1,8 +1,8 @@
[info] [info]
name: Flashing Keyboard name: Flashing Keyboard
short_name: flashing_keyboard short_name: flashing_keyboard
version: 0.3 version: 0.4
description: Flashing keyboard led when there are unread messages. description: Flashing keyboard led when there are unread messages.
authors: Denis Fomin <fominde@gmail.com> authors: Denis Fomin <fominde@gmail.com>
homepage: https://dev.gajim.org/gajim/gajim-plugins/wikis/flashingkeyboardplugin homepage: https://dev.gajim.org/gajim/gajim-plugins/wikis/flashingkeyboardplugin
min_gajim_version: 0.16.10 min_gajim_version: 0.16.11

View File

@@ -18,7 +18,7 @@
## ##
import dbus import dbus
from common import gajim from common import app
from common import ged from common import ged
from common import dbus_support from common import dbus_support
import gui_interface import gui_interface
@@ -46,11 +46,11 @@ class GnomeSessionManagerPlugin(GajimPlugin):
self.session_presence = self.bus.get_object("org.gnome.SessionManager", self.session_presence = self.bus.get_object("org.gnome.SessionManager",
"/org/gnome/SessionManager/Presence") "/org/gnome/SessionManager/Presence")
except: except:
gajim.log.debug("GNOME SessionManager D-Bus service not found") app.log.debug("GNOME SessionManager D-Bus service not found")
return return
self.active = True self.active = True
gajim.ged.register_event_handler('our-show', ged.POSTGUI, app.ged.register_event_handler('our-show', ged.POSTGUI,
self.on_our_status) self.on_our_status)
self.bus.add_signal_receiver(self.gnome_presence_changed, self.bus.add_signal_receiver(self.gnome_presence_changed,
"StatusChanged", PRESENCE_INTERFACE) "StatusChanged", PRESENCE_INTERFACE)
@@ -63,17 +63,17 @@ class GnomeSessionManagerPlugin(GajimPlugin):
self.active = False self.active = False
self.bus.remove_signal_receiver(self.gnome_presence_changed, "StatusChanged", self.bus.remove_signal_receiver(self.gnome_presence_changed, "StatusChanged",
dbus_interface=PRESENCE_INTERFACE) dbus_interface=PRESENCE_INTERFACE)
gajim.ged.remove_event_handler('our-show', ged.POSTGUI, self.on_our_status) app.ged.remove_event_handler('our-show', ged.POSTGUI, self.on_our_status)
def gnome_presence_changed(self, status, *args, **kw): def gnome_presence_changed(self, status, *args, **kw):
if not gajim.interface.remote_ctrl: if not app.interface.remote_ctrl:
try: try:
import remote_control import remote_control
gajim.interface.remote_ctrl = remote_control.Remote() app.interface.remote_ctrl = remote_control.Remote()
except: except:
return return
remote_gajim = gajim.interface.remote_ctrl.signal_object remote_gajim = app.interface.remote_ctrl.signal_object
gajim_status = GNOME_STATUS[status] gajim_status = GNOME_STATUS[status]
accounts = remote_gajim.list_accounts() accounts = remote_gajim.list_accounts()
for account in accounts: for account in accounts:

View File

@@ -1,9 +1,9 @@
[info] [info]
name: Google Translation name: Google Translation
short_name: google_translation short_name: google_translation
version: 0.3.2 version: 0.3.3
description: Translates (currently only incoming) messages using Google Translate. description: Translates (currently only incoming) messages using Google Translate.
authors: Mateusz Biliński <mateusz@bilinski.it> authors: Mateusz Biliński <mateusz@bilinski.it>
mrDoctorWho <mrdoctorwho@gmail.com> mrDoctorWho <mrdoctorwho@gmail.com>
homepage: http://trac-plugins.gajim.org/wiki/GoogleTranslationPlugin homepage: http://trac-plugins.gajim.org/wiki/GoogleTranslationPlugin
min_gajim_version: 0.16.10 min_gajim_version: 0.16.11

View File

@@ -32,15 +32,12 @@ import urllib
from gi.repository import Gtk from gi.repository import Gtk
from sys import getfilesystemencoding from sys import getfilesystemencoding
import chat_control from gajim import chat_control
import groupchat_control from gajim import groupchat_control
from common import helpers from gajim.plugins import GajimPlugin
from common import gajim from gajim.plugins.helpers import log_calls
from gajim.common import ged
from plugins import GajimPlugin
from plugins.helpers import log_calls
from common import ged
languages = { languages = {
_('Afrikaans'): 'af', _('Afrikaans'): 'af',

View File

@@ -3,9 +3,9 @@
from gi.repository import Gtk from gi.repository import Gtk
from gi.repository import GdkPixbuf from gi.repository import GdkPixbuf
from common import gajim from gajim.common import app
from plugins import GajimPlugin from gajim.plugins import GajimPlugin
from plugins.helpers import log_calls from gajim.plugins.helpers import log_calls
class GuiForMe(GajimPlugin): class GuiForMe(GajimPlugin):
@@ -43,7 +43,7 @@ class GuiForMe(GajimPlugin):
if base.chat_control != chat_control: if base.chat_control != chat_control:
continue continue
base.button.set_sensitive(chat_control.contact.show != 'offline' \ base.button.set_sensitive(chat_control.contact.show != 'offline' \
and gajim.connections[chat_control.account].connected > 0) and app.connections[chat_control.account].connected > 0)
class Base(object): class Base(object):

View File

@@ -1,10 +1,10 @@
[info] [info]
name: GUI For Me name: GUI For Me
short_name: gui_for_me short_name: gui_for_me
version: 0.2 version: 0.3
description: Gui for the '/me' command. description: Gui for the '/me' command.
authors: BomberMan authors: BomberMan
copper copper
Denis Fomin <fominde@gmail.com> Denis Fomin <fominde@gmail.com>
homepage: http://trac-plugins.gajim.org/wiki/GUIForMePlugin homepage: http://trac-plugins.gajim.org/wiki/GUIForMePlugin
min_gajim_version: 0.16.10 min_gajim_version: 0.16.11

View File

@@ -5,13 +5,13 @@ import datetime as dt
from gi.repository import GObject from gi.repository import GObject
import os import os
from common import gajim from gajim.common import app
from common import ged from gajim.common import ged
from common import dbus_support from gajim.common import dbus_support
from plugins import GajimPlugin from gajim.plugins import GajimPlugin
from plugins.helpers import log_calls, log from gajim.plugins.helpers import log_calls, log
from common.pep import ACTIVITIES from gajim.common.pep import ACTIVITIES
HAMSTAER_INTERFACE = 'org.gnome.Hamster' HAMSTAER_INTERFACE = 'org.gnome.Hamster'
SUBACTIVITIES = [] SUBACTIVITIES = []
@@ -45,12 +45,12 @@ class HamsterIntegrationPlugin(GajimPlugin):
self.session_presence = self.bus.get_object(HAMSTAER_INTERFACE, self.session_presence = self.bus.get_object(HAMSTAER_INTERFACE,
'/org/gnome/Hamster') '/org/gnome/Hamster')
except: except:
gajim.log.debug('Hamster D-Bus service not found') app.log.debug('Hamster D-Bus service not found')
return return
self.bus.add_signal_receiver(self.hamster_facts_changed, 'FactsChanged', self.bus.add_signal_receiver(self.hamster_facts_changed, 'FactsChanged',
HAMSTAER_INTERFACE) HAMSTAER_INTERFACE)
gajim.ged.register_event_handler('signed-in', ged.POSTGUI, app.ged.register_event_handler('signed-in', ged.POSTGUI,
self.on_signed_in) self.on_signed_in)
@log_calls('HamsterIntegrationPlugin') @log_calls('HamsterIntegrationPlugin')
@@ -60,7 +60,7 @@ class HamsterIntegrationPlugin(GajimPlugin):
self.bus.remove_signal_receiver(self.hamster_facts_changed, self.bus.remove_signal_receiver(self.hamster_facts_changed,
"FactsChanged", dbus_interface=HAMSTAER_INTERFACE) "FactsChanged", dbus_interface=HAMSTAER_INTERFACE)
gajim.ged.remove_event_handler('signed-in', ged.POSTGUI, app.ged.remove_event_handler('signed-in', ged.POSTGUI,
self.on_signed_in) self.on_signed_in)
def hamster_facts_changed(self, *args, **kw): def hamster_facts_changed(self, *args, **kw):
@@ -70,10 +70,10 @@ class HamsterIntegrationPlugin(GajimPlugin):
if not facts: if not facts:
return return
if self.from_dbus_fact(facts[-1])['end_time']: if self.from_dbus_fact(facts[-1])['end_time']:
accounts = list(gajim.connections.keys()) accounts = list(app.connections.keys())
for account in accounts: for account in accounts:
if gajim.account_is_connected(account): if app.account_is_connected(account):
connection = gajim.connections[account] connection = app.connections[account]
connection.retract_activity() connection.retract_activity()
return return
@@ -90,9 +90,9 @@ class HamsterIntegrationPlugin(GajimPlugin):
subactivity=list(subactivity_candidates)[0] subactivity=list(subactivity_candidates)[0]
# send activity # send activity
for account in gajim.connections: for account in app.connections:
if gajim.account_is_connected(account): if app.account_is_connected(account):
connection = gajim.connections[account] connection = app.connections[account]
connection.send_activity(activity, subactivity, connection.send_activity(activity, subactivity,
last_fact['fact']) last_fact['fact'])

View File

@@ -1,10 +1,10 @@
[info] [info]
name: Hamster integration name: Hamster integration
short_name: hamster_integration short_name: hamster_integration
version: 0.1.3 version: 0.1.4
description: Integration with project hamster description: Integration with project hamster
see https://trac.gajim.org/ticket/6993 see https://trac.gajim.org/ticket/6993
and http://projecthamster.wordpress.com/about/ and http://projecthamster.wordpress.com/about/
authors: Denis Fomin <fominde@gmail.com> authors: Denis Fomin <fominde@gmail.com>
homepage: http://trac-plugins.gajim.org/wiki/ homepage: http://trac-plugins.gajim.org/wiki/
min_gajim_version: 0.16.10 min_gajim_version: 0.16.11

View File

@@ -29,10 +29,10 @@ if os.name == 'nt':
import nbxmpp import nbxmpp
from gi.repository import Gtk, GLib from gi.repository import Gtk, GLib
from common import gajim from gajim.common import app
from common import ged from gajim.common import ged
from plugins import GajimPlugin from gajim.plugins import GajimPlugin
from dialogs import FileChooserDialog, ErrorDialog from gajim.dialogs import FileChooserDialog, ErrorDialog
log = logging.getLogger('gajim.plugin_system.httpupload') log = logging.getLogger('gajim.plugin_system.httpupload')
@@ -73,7 +73,7 @@ class HTTPUploadPlugin(GajimPlugin):
def handle_agent_info_received(self, event): def handle_agent_info_received(self, event):
if (NS_HTTPUPLOAD in event.features and if (NS_HTTPUPLOAD in event.features and
gajim.jid_is_transport(event.jid)): app.jid_is_transport(event.jid)):
account = event.conn.name account = event.conn.name
interface = self.get_interface(account) interface = self.get_interface(account)
interface.enabled = True interface.enabled = True
@@ -102,7 +102,7 @@ class HTTPUploadPlugin(GajimPlugin):
def update_chat_control(self, chat_control): def update_chat_control(self, chat_control):
account = chat_control.account account = chat_control.account
if gajim.connections[account].connection is None: if app.connections[account].connection is None:
self.get_interface(account).update_button_states(False) self.get_interface(account).update_button_states(False)
def get_interface(self, account): def get_interface(self, account):
@@ -223,7 +223,7 @@ class Base(object):
def encrypt_file(self, file): def encrypt_file(self, file):
GLib.idle_add(file.progress.label.set_text, _('Encrypting file...')) GLib.idle_add(file.progress.label.set_text, _('Encrypting file...'))
encryption = file.control.encryption encryption = file.control.encryption
plugin = gajim.plugin_manager.encryption_plugins[encryption] plugin = app.plugin_manager.encryption_plugins[encryption]
if hasattr(plugin, 'encrypt_file'): if hasattr(plugin, 'encrypt_file'):
plugin.encrypt_file(file, self.account, self.request_slot) plugin.encrypt_file(file, self.account, self.request_slot)
else: else:
@@ -237,7 +237,7 @@ class Base(object):
GLib.idle_add(file.progress.label.set_text, GLib.idle_add(file.progress.label.set_text,
_('Requesting HTTP Upload Slot...')) _('Requesting HTTP Upload Slot...'))
iq = nbxmpp.Iq(typ='get', to=self.component) iq = nbxmpp.Iq(typ='get', to=self.component)
id_ = gajim.get_an_id() id_ = app.get_an_id()
iq.setID(id_) iq.setID(id_)
request = iq.setTag(name="request", namespace=NS_HTTPUPLOAD) request = iq.setTag(name="request", namespace=NS_HTTPUPLOAD)
request.addChild('filename', payload=os.path.basename(file.path)) request.addChild('filename', payload=os.path.basename(file.path))
@@ -246,7 +246,7 @@ class Base(object):
log.info("Sending request for slot") log.info("Sending request for slot")
IQ_CALLBACK[id_] = lambda stanza: self.received_slot(stanza, file) IQ_CALLBACK[id_] = lambda stanza: self.received_slot(stanza, file)
gajim.connections[self.account].connection.send(iq) app.connections[self.account].connection.send(iq)
def received_slot(self, stanza, file): def received_slot(self, stanza, file):
log.info("Received slot") log.info("Received slot")
@@ -301,9 +301,10 @@ class Base(object):
GLib.idle_add(file.progress.label.set_text, GLib.idle_add(file.progress.label.set_text,
_('Uploading file via HTTP...')) _('Uploading file via HTTP...'))
try: try:
headers = {'User-Agent': 'Gajim %s' % gajim.version, headers = {'User-Agent': 'Gajim %s' % app.version,
'Content-Type': file.mime, 'Content-Type': file.mime,
'Content-Length': file.size} 'Content-Length': file.size}
request = Request( request = Request(
file.put, data=file.stream, headers=headers, method='PUT') file.put, data=file.stream, headers=headers, method='PUT')
log.info("Opening Urllib upload request...") log.info("Opening Urllib upload request...")

View File

@@ -1,11 +1,11 @@
[info] [info]
name: HttpUpload name: HttpUpload
short_name: httpupload short_name: httpupload
version: 0.6.4 version: 0.6.5
description: This plugin is designed to send a file to a contact or muc by using httpupload.<br/> description: This plugin is designed to send a file to a contact or muc by using httpupload.<br/>
Your server must support <a href="http://xmpp.org/extensions/xep-0363.html">XEP-0363: HTTP Upload</a>.<br/> Your server must support <a href="http://xmpp.org/extensions/xep-0363.html">XEP-0363: HTTP Upload</a>.<br/>
authors: Thilo Molitor <thilo@eightysoft.de> authors: Thilo Molitor <thilo@eightysoft.de>
Philipp Hörist <philipp@hoerist.com> Philipp Hörist <philipp@hoerist.com>
Linus Heckemann <linus@sphalerite.org> Linus Heckemann <linus@sphalerite.org>
homepage: https://dev.gajim.org/gajim/gajim-plugins/wikis/HttpUploadPlugin homepage: https://dev.gajim.org/gajim/gajim-plugins/wikis/HttpUploadPlugin
min_gajim_version: 0.16.10 min_gajim_version: 0.16.11

View File

@@ -7,10 +7,10 @@ import os
import base64 import base64
import urllib import urllib
import chat_control from gajim import chat_control
from plugins import GajimPlugin from gajim.plugins import GajimPlugin
from plugins.helpers import log_calls from gajim.plugins.helpers import log_calls
from dialogs import ImageChooserDialog, ErrorDialog from gajim.dialogs import ImageChooserDialog, ErrorDialog
NS_XHTML_IM = 'http://jabber.org/protocol/xhtml-im' # XEP-0071 NS_XHTML_IM = 'http://jabber.org/protocol/xhtml-im' # XEP-0071

View File

@@ -1,10 +1,10 @@
[info] [info]
name: Image name: Image
short_name: image short_name: image
version: 0.5.1 version: 0.5.2
description: This plugin is designed to send a small(0 - 40 kb) graphic image to your contact. description: This plugin is designed to send a small(0 - 40 kb) graphic image to your contact.
Client on the other side must support XEP-0071: XHTML-IM and maintain the scheme data: URI. Client on the other side must support XEP-0071: XHTML-IM and maintain the scheme data: URI.
Psi+ and Jabbim supported this. Psi+ and Jabbim supported this.
authors: Denis Fomin <fominde@gmail.com> authors: Denis Fomin <fominde@gmail.com>
homepage: http://trac-plugins.gajim.org/wiki/ImagePlugin homepage: http://trac-plugins.gajim.org/wiki/ImagePlugin
min_gajim_version: 0.16.10 min_gajim_version: 0.16.11

View File

@@ -1,10 +1,10 @@
[info] [info]
name: Juick name: Juick
short_name: Juick short_name: Juick
version: 0.9.5 version: 0.9.6
description: Clickable Juick links , Juick nicks, preview Juick picturs. description: Clickable Juick links , Juick nicks, preview Juick picturs.
The key combination alt + up in the textbox allow insert the number of last message (comment or topic). The key combination alt + up in the textbox allow insert the number of last message (comment or topic).
authors: Denis Fomin <fominde@gmail.com> authors: Denis Fomin <fominde@gmail.com>
evgen <drujebober@gmail.com> evgen <drujebober@gmail.com>
homepage: http://trac-plugins.gajim.org/wiki/JuickPlugin homepage: http://trac-plugins.gajim.org/wiki/JuickPlugin
min_gajim_version: 0.16.10 min_gajim_version: 0.16.11

View File

@@ -10,13 +10,13 @@ import time
import locale import locale
import sqlite3 import sqlite3
from common import helpers from gajim.common import helpers
from common import gajim from gajim.common import app
from plugins import GajimPlugin from gajim.plugins import GajimPlugin
from plugins.helpers import log_calls, log from gajim.plugins.helpers import log_calls, log
from plugins.gui import GajimPluginConfigDialog from gajim.plugins.gui import GajimPluginConfigDialog
from conversation_textview import TextViewImage from gajim.conversation_textview import TextViewImage
import gtkgui_helpers from gajim import gtkgui_helpers
import nbxmpp import nbxmpp
@@ -58,7 +58,7 @@ class JuickPlugin(GajimPlugin):
self.chat_control = None self.chat_control = None
self.controls = [] self.controls = []
self.conn = None self.conn = None
self.cache_path = os.path.join(gajim.AVATAR_PATH, 'juick') self.cache_path = os.path.join(app.AVATAR_PATH, 'juick')
if not os.path.isdir(self.cache_path): if not os.path.isdir(self.cache_path):
os.makedirs(self.cache_path) os.makedirs(self.cache_path)
@@ -149,7 +149,7 @@ class Base(object):
sharp_slash = r'#\d+(\/\d+)?' sharp_slash = r'#\d+(\/\d+)?'
juick_nick = r'@[a-zA-Z0-9_@:\.-]+' juick_nick = r'@[a-zA-Z0-9_@:\.-]+'
juick_pic = r'http://i\.juick\.com/.+/[0-9-]+\.[JPG|jpg]' juick_pic = r'http://i\.juick\.com/.+/[0-9-]+\.[JPG|jpg]'
interface = gajim.interface interface = app.interface
interface.sharp_slash_re = re.compile(sharp_slash) interface.sharp_slash_re = re.compile(sharp_slash)
self.juick_nick_re = interface.juick_nick_re = re.compile(juick_nick) self.juick_nick_re = interface.juick_nick_re = re.compile(juick_nick)
self.juick_pic_re = interface.juick_pic_re = re.compile(juick_pic) self.juick_pic_re = interface.juick_pic_re = re.compile(juick_pic)
@@ -282,7 +282,7 @@ class Base(object):
return return
childs = self.juick_link_menu.get_children() childs = self.juick_link_menu.get_children()
if post: if post:
self.juick_post_full = gajim.interface.sharp_slash_re\ self.juick_post_full = app.interface.sharp_slash_re\
.search(word).group(0) .search(word).group(0)
self.juick_post_uid = post.group(1) self.juick_post_uid = post.group(1)
for menuitem in range(7): for menuitem in range(7):
@@ -315,14 +315,14 @@ class Base(object):
self.on_insert(widget, 'PM %s' % word.rstrip(':')) self.on_insert(widget, 'PM %s' % word.rstrip(':'))
def print_special_text(self, special_text, other_tags, graphics=True): def print_special_text(self, special_text, other_tags, graphics=True):
if gajim.interface.sharp_slash_re.match(special_text): if app.interface.sharp_slash_re.match(special_text):
# insert post num #123456// # insert post num #123456//
buffer_, iter_, tag = self.get_iter_and_tag('sharp_slash') buffer_, iter_, tag = self.get_iter_and_tag('sharp_slash')
buffer_.insert_with_tags(iter_, special_text, tag) buffer_.insert_with_tags(iter_, special_text, tag)
self.last_juick_num = special_text self.last_juick_num = special_text
self.textview.plugin_modified = True self.textview.plugin_modified = True
return return
if gajim.interface.juick_nick_re.match(special_text): if app.interface.juick_nick_re.match(special_text):
# insert juick nick @nickname//// # insert juick nick @nickname////
buffer_, iter_, tag = self.get_iter_and_tag('juick_nick') buffer_, iter_, tag = self.get_iter_and_tag('juick_nick')
mark = buffer_.create_mark(None, iter_, True) mark = buffer_.create_mark(None, iter_, True)
@@ -342,13 +342,13 @@ class Base(object):
if self.plugin.config['ONLY_FIRST_AVATAR']: if self.plugin.config['ONLY_FIRST_AVATAR']:
if b_nick[-9:] not in ('Reply by ', 'message from ', 'ended by ', if b_nick[-9:] not in ('Reply by ', 'message from ', 'ended by ',
'Subscribed to '): 'Subscribed to '):
if b_nick[-2] != gajim.config.get('after_nickname'): if b_nick[-2] != app.config.get('after_nickname'):
self.textview.plugin_modified = True self.textview.plugin_modified = True
return return
elif b_nick[-1] == '\n': elif b_nick[-1] == '\n':
self.textview.plugin_modified = True self.textview.plugin_modified = True
return return
conn = gajim.connections[self.chat_control.account] conn = app.connections[self.chat_control.account]
if not conn.connected: if not conn.connected:
self.textview.plugin_modified = True self.textview.plugin_modified = True
return return
@@ -384,7 +384,7 @@ class Base(object):
{'mark': mark, 'special_text': special_text}) {'mark': mark, 'special_text': special_text})
self.textview.plugin_modified = True self.textview.plugin_modified = True
return return
if gajim.interface.juick_pic_re.match(special_text) and \ if app.interface.juick_pic_re.match(special_text) and \
self.plugin.config['SHOW_PREVIEW']: self.plugin.config['SHOW_PREVIEW']:
# show pics preview # show pics preview
buffer_, iter_, tag = self.get_iter_and_tag('url') buffer_, iter_, tag = self.get_iter_and_tag('url')
@@ -392,7 +392,7 @@ class Base(object):
buffer_.insert_with_tags(iter_, special_text, tag) buffer_.insert_with_tags(iter_, special_text, tag)
uid = special_text.split('/')[-1] uid = special_text.split('/')[-1]
url = "http://i.juick.com/photos-512/%s" % uid url = "http://i.juick.com/photos-512/%s" % uid
gajim.thread_interface(self.insert_pic_preview, [mark, special_text, app.thread_interface(self.insert_pic_preview, [mark, special_text,
url]) url])
self.textview.plugin_modified = True self.textview.plugin_modified = True
return return

View File

@@ -32,10 +32,10 @@ from tempfile import mkstemp, mkdtemp
import random import random
from subprocess import Popen, PIPE from subprocess import Popen, PIPE
from common import gajim from gajim.common import app
from plugins import GajimPlugin from gajim.plugins import GajimPlugin
from plugins.helpers import log, log_calls from gajim.plugins.helpers import log, log_calls
from plugins.gui import GajimPluginConfigDialog from gajim.plugins.gui import GajimPluginConfigDialog
Gdk.threads_init() Gdk.threads_init()
@@ -145,7 +145,7 @@ class LatexRenderer(Thread):
def fg_str(fmt): def fg_str(fmt):
try: try:
return [{'hex' : '+level-colors', 'tex' : '-fg'}[fmt], return [{'hex' : '+level-colors', 'tex' : '-fg'}[fmt],
gajim.interface.get_fg_color(fmt)] app.interface.get_fg_color(fmt)]
except KeyError: except KeyError:
# interface may not be available when we test latex at startup # interface may not be available when we test latex at startup
return [] return []

View File

@@ -1,9 +1,9 @@
[info] [info]
name: Latex name: Latex
short_name: latex short_name: latex
version: 0.3.1 version: 0.3.2
description: render received latex code description: render received latex code
authors: Yves Fischer <yvesf@xapek.org> authors: Yves Fischer <yvesf@xapek.org>
Yann Leboulanger <asterix@lagaule.org> Yann Leboulanger <asterix@lagaule.org>
homepage: http://trac-plugins.gajim.org/wiki/LatexPlugin homepage: http://trac-plugins.gajim.org/wiki/LatexPlugin
min_gajim_version: 0.16.10 min_gajim_version: 0.16.11

View File

@@ -29,9 +29,9 @@ import sys
from gi.repository import Gtk from gi.repository import Gtk
from gi.repository import Gdk from gi.repository import Gdk
from plugins import GajimPlugin from gajim.plugins import GajimPlugin
from plugins.helpers import log, log_calls from gajim.plugins.helpers import log, log_calls
from plugins.gui import GajimPluginConfigDialog from gajim.plugins.gui import GajimPluginConfigDialog
class LengthNotifierPlugin(GajimPlugin): class LengthNotifierPlugin(GajimPlugin):

View File

@@ -1,8 +1,8 @@
[info] [info]
name: Message Length Notifier name: Message Length Notifier
short_name: length_notifier short_name: length_notifier
version: 0.2 version: 0.3
description: Highlights message entry field in chat window when given length of message is exceeded. description: Highlights message entry field in chat window when given length of message is exceeded.
authors = Mateusz Biliński <mateusz@bilinski.it> authors = Mateusz Biliński <mateusz@bilinski.it>
homepage = http://trac-plugins.gajim.org/wiki/LengthNotifierPlugin homepage = http://trac-plugins.gajim.org/wiki/LengthNotifierPlugin
min_gajim_version: 0.16.10 min_gajim_version: 0.16.11

View File

@@ -1,8 +1,8 @@
[info] [info]
name: Message Box Size name: Message Box Size
short_name: message_box_size short_name: message_box_size
version: 0.3 version: 0.4
description: Allows you to adjust the height of the new message input field. description: Allows you to adjust the height of the new message input field.
authors: Denis Fomin <fominde@gmail.com> authors: Denis Fomin <fominde@gmail.com>
homepage: http://trac-plugins.gajim.org/wiki/MessageBoxSizePlugin homepage: http://trac-plugins.gajim.org/wiki/MessageBoxSizePlugin
min_gajim_version: 0.16.10 min_gajim_version: 0.16.11

View File

@@ -2,10 +2,10 @@
from gi.repository import Gtk from gi.repository import Gtk
from common import gajim from gajim.common import app
from plugins import GajimPlugin from gajim.plugins import GajimPlugin
from plugins.helpers import log_calls from gajim.plugins.helpers import log_calls
from plugins.gui import GajimPluginConfigDialog from gajim.plugins.gui import GajimPluginConfigDialog
class MsgBoxSizePlugin(GajimPlugin): class MsgBoxSizePlugin(GajimPlugin):

View File

@@ -1,8 +1,8 @@
[info] [info]
name: MPRIS2 support name: MPRIS2 support
short_name: mpris2_support short_name: mpris2_support
version: 0.3.3 version: 0.3.4
description: MPRIS2 support. Allows to update status message according to the music you're listening via the MPRIS2 D-Bus API. description: MPRIS2 support. Allows to update status message according to the music you're listening via the MPRIS2 D-Bus API.
authors = Denis Fomin <fominde@gmail.com> authors = Denis Fomin <fominde@gmail.com>
homepage = https://dev.gajim.org/gajim/gajim-plugins/wikis/mprissupportplugin homepage = https://dev.gajim.org/gajim/gajim-plugins/wikis/mprissupportplugin
min_gajim_version: 0.16.10 min_gajim_version: 0.16.11

View File

@@ -2,14 +2,14 @@
import os import os
from plugins import GajimPlugin from gajim.plugins import GajimPlugin
from plugins.helpers import log_calls from gajim.plugins.helpers import log_calls
from common import dbus_support from gajim.common import dbus_support
ERR_MSG = '' ERR_MSG = ''
if dbus_support.supported: if dbus_support.supported:
from music_track_listener import MusicTrackListener from gajim.music_track_listener import MusicTrackListener
else: else:
ERR_MSG = 'D-Bus Python bindings are missing' ERR_MSG = 'D-Bus Python bindings are missing'

View File

@@ -1,8 +1,8 @@
[info] [info]
name: Now Listen name: Now Listen
short_name: now-listen short_name: now-listen
version: 0.2.3 version: 0.2.4
description: Copy tune info to conversation input box (alt + n) at cursor position description: Copy tune info to conversation input box (alt + n) at cursor position
authors = Denis Fomin <fominde@gmail.com> authors = Denis Fomin <fominde@gmail.com>
homepage = https://dev.gajim.org/gajim/gajim-plugins/wikis/NowListenPlugin homepage = https://dev.gajim.org/gajim/gajim-plugins/wikis/NowListenPlugin
min_gajim_version: 0.16.10 min_gajim_version: 0.16.11

View File

@@ -4,14 +4,14 @@ from gi.repository import Gtk
from gi.repository import Gdk from gi.repository import Gdk
import os import os
from plugins import GajimPlugin from gajim.plugins import GajimPlugin
from plugins.helpers import log_calls from gajim.plugins.helpers import log_calls
from plugins.gui import GajimPluginConfigDialog from gajim.plugins.gui import GajimPluginConfigDialog
from plugins.gajimplugin import GajimPluginException from gajim.plugins.gajimplugin import GajimPluginException
from common import dbus_support from gajim.common import dbus_support
if dbus_support.supported: if dbus_support.supported:
from music_track_listener import MusicTrackListener from gajim.music_track_listener import MusicTrackListener
class NowListenPlugin(GajimPlugin): class NowListenPlugin(GajimPlugin):

View File

@@ -8,7 +8,7 @@ from plugins.gui import GajimPluginConfigDialog
from plugins import GajimPlugin from plugins import GajimPlugin
from plugins.helpers import log_calls from plugins.helpers import log_calls
from common import ged from common import ged
from common import gajim from common import app
from common.i18n import Q_ from common.i18n import Q_
from config import ManageBookmarksWindow from config import ManageBookmarksWindow
@@ -41,7 +41,7 @@ class OfflineBookmarksPlugin(GajimPlugin):
pass pass
def save_bookmarks(self, account, bookmarks): def save_bookmarks(self, account, bookmarks):
jid = gajim.get_jid_from_account(account) jid = app.get_jid_from_account(account)
if jid not in self.config: if jid not in self.config:
self.config[jid] = {} self.config[jid] = {}
self.config[jid] = bookmarks self.config[jid] = bookmarks
@@ -51,22 +51,22 @@ class OfflineBookmarksPlugin(GajimPlugin):
def handle_event_signed_in(self, obj): def handle_event_signed_in(self, obj):
account = obj.conn.name account = obj.conn.name
connection = gajim.connections[account] connection = app.connections[account]
jid = gajim.get_jid_from_account(obj.conn.name) jid = app.get_jid_from_account(obj.conn.name)
bm_jids = [b['jid'] for b in connection.bookmarks] bm_jids = [b['jid'] for b in connection.bookmarks]
if jid in self.config: if jid in self.config:
for bm in self.config[jid]: for bm in self.config[jid]:
if bm['jid'] not in bm_jids: if bm['jid'] not in bm_jids:
connection.bookmarks.append(bm) connection.bookmarks.append(bm)
invisible_show = gajim.SHOW_LIST.index('invisible') invisible_show = app.SHOW_LIST.index('invisible')
# do not autojoin if we are invisible # do not autojoin if we are invisible
if connection.connected == invisible_show: if connection.connected == invisible_show:
return return
# do not autojoin if bookmarks supported # do not autojoin if bookmarks supported
bookmarks_supported = self.is_bookmark_supported( bookmarks_supported = self.is_bookmark_supported(
gajim.connections[account]) app.connections[account])
if not bookmarks_supported: if not bookmarks_supported:
gajim.interface.auto_join_bookmarks(connection.name) app.interface.auto_join_bookmarks(connection.name)
def connect_with_gc_control(self, gc_control): def connect_with_gc_control(self, gc_control):
control = Base(self, gc_control) control = Base(self, gc_control)
@@ -111,14 +111,14 @@ class Base(object):
self.button.set_no_show_all(True) self.button.set_no_show_all(True)
id_ = self.button.connect('clicked', self.add_bookmark_button_clicked) id_ = self.button.connect('clicked', self.add_bookmark_button_clicked)
self.gc_control.handlers[id_] = self.button self.gc_control.handlers[id_] = self.button
for bm in gajim.connections[self.gc_control.account].bookmarks: for bm in app.connections[self.gc_control.account].bookmarks:
if bm['jid'] == self.gc_control.contact.jid: if bm['jid'] == self.gc_control.contact.jid:
self.button.hide() self.button.hide()
break break
else: else:
account = self.gc_control.account account = self.gc_control.account
bookmarks_supported = self.plugin.is_bookmark_supported( bookmarks_supported = self.plugin.is_bookmark_supported(
gajim.connections[account]) app.connections[account])
self.button.set_sensitive(not bookmarks_supported) self.button.set_sensitive(not bookmarks_supported)
self.button.set_visible(not bookmarks_supported) self.button.set_visible(not bookmarks_supported)
@@ -127,7 +127,7 @@ class Base(object):
Bookmark the room, without autojoin and not minimized Bookmark the room, without autojoin and not minimized
""" """
from dialogs import ErrorDialog, InformationDialog from dialogs import ErrorDialog, InformationDialog
password = gajim.gc_passwords.get(self.gc_control.room_jid, '') password = app.gc_passwords.get(self.gc_control.room_jid, '')
account = self.gc_control.account account = self.gc_control.account
bm = {'name': self.gc_control.name, bm = {'name': self.gc_control.name,
@@ -140,7 +140,7 @@ class Base(object):
place_found = False place_found = False
index = 0 index = 0
# check for duplicate entry and respect alpha order # check for duplicate entry and respect alpha order
for bookmark in gajim.connections[account].bookmarks: for bookmark in app.connections[account].bookmarks:
if bookmark['jid'] == bm['jid']: if bookmark['jid'] == bm['jid']:
ErrorDialog( ErrorDialog(
_('Bookmark already set'), _('Bookmark already set'),
@@ -152,11 +152,11 @@ class Base(object):
break break
index += 1 index += 1
if place_found: if place_found:
gajim.connections[account].bookmarks.insert(index, bm) app.connections[account].bookmarks.insert(index, bm)
else: else:
gajim.connections[account].bookmarks.append(bm) app.connections[account].bookmarks.append(bm)
self.plugin.save_bookmarks(account, gajim.connections[account].bookmarks) self.plugin.save_bookmarks(account, app.connections[account].bookmarks)
gajim.interface.roster.set_actions_menu_needs_rebuild() app.interface.roster.set_actions_menu_needs_rebuild()
InformationDialog( InformationDialog(
_('Bookmark has been added successfully'), _('Bookmark has been added successfully'),
_('You can manage your bookmarks via Actions menu in your roster.')) _('You can manage your bookmarks via Actions menu in your roster.'))
@@ -242,18 +242,18 @@ class OfflineBookmarksPluginConfigDialog(GajimPluginConfigDialog,
self.jids = [] self.jids = []
# Store bookmarks in treeview. # Store bookmarks in treeview.
for account in gajim.connections: for account in app.connections:
if gajim.connections[account].connected <= 1: if app.connections[account].connected <= 1:
continue continue
if gajim.connections[account].is_zeroconf: if app.connections[account].is_zeroconf:
continue continue
self.accounts.append(account) self.accounts.append(account)
self.jids.append(gajim.get_jid_from_account(account)) self.jids.append(app.get_jid_from_account(account))
iter_ = self.treestore.append(None, [None, account, None, None, iter_ = self.treestore.append(None, [None, account, None, None,
None, None, None, None]) None, None, None, None])
for bookmark in gajim.connections[account].bookmarks: for bookmark in app.connections[account].bookmarks:
if bookmark['name'] == '': if bookmark['name'] == '':
# No name was given for this bookmark. # No name was given for this bookmark.
# Use the first part of JID instead... # Use the first part of JID instead...
@@ -303,7 +303,7 @@ class OfflineBookmarksPluginConfigDialog(GajimPluginConfigDialog,
for account in self.treestore: for account in self.treestore:
account_unicode = account[1].decode('utf-8') account_unicode = account[1].decode('utf-8')
gajim.connections[account_unicode].bookmarks = [] app.connections[account_unicode].bookmarks = []
for bm in account.iterchildren(): for bm in account.iterchildren():
# Convert True/False/None to '1' or '0' # Convert True/False/None to '1' or '0'
@@ -327,15 +327,15 @@ class OfflineBookmarksPluginConfigDialog(GajimPluginConfigDialog,
'minimize': minimize, 'password': pw, 'nick': nick, 'minimize': minimize, 'password': pw, 'nick': nick,
'print_status': bm[7]} 'print_status': bm[7]}
gajim.connections[account_unicode].bookmarks.append(bmdict) app.connections[account_unicode].bookmarks.append(bmdict)
bookmarks_supported = self.plugin.is_bookmark_supported( bookmarks_supported = self.plugin.is_bookmark_supported(
gajim.connections[account_unicode]) app.connections[account_unicode])
if bookmarks_supported: if bookmarks_supported:
gajim.connections[account_unicode].store_bookmarks() app.connections[account_unicode].store_bookmarks()
self.plugin.save_bookmarks(account_unicode, self.plugin.save_bookmarks(account_unicode,
gajim.connections[account_unicode].bookmarks) app.connections[account_unicode].bookmarks)
gajim.interface.roster.set_actions_menu_needs_rebuild() app.interface.roster.set_actions_menu_needs_rebuild()
def on_import_to_changed(self, treeview): def on_import_to_changed(self, treeview):
self.on_import_from_changed(self.import_from_combo) self.on_import_from_changed(self.import_from_combo)
@@ -351,11 +351,11 @@ class OfflineBookmarksPluginConfigDialog(GajimPluginConfigDialog,
def on_import_button_clicked(self, widget): def on_import_button_clicked(self, widget):
from_ = self.import_from_combo.get_active_text() from_ = self.import_from_combo.get_active_text()
to_connection = gajim.connections[self.import_to_combo.get_active_text()] to_connection = app.connections[self.import_to_combo.get_active_text()]
to_bookmarks = to_connection.bookmarks to_bookmarks = to_connection.bookmarks
if from_ in self.accounts: if from_ in self.accounts:
from_bookmarks = gajim.connections[from_].bookmarks from_bookmarks = app.connections[from_].bookmarks
else: else:
from_bookmarks = self.plugin.config[from_] from_bookmarks = self.plugin.config[from_]
for bm in from_bookmarks: for bm in from_bookmarks:

View File

@@ -31,9 +31,9 @@ from urllib.parse import urlparse, urldefrag
from io import BufferedWriter, FileIO, BytesIO from io import BufferedWriter, FileIO, BytesIO
from gi.repository import GLib from gi.repository import GLib
import gtkgui_helpers from gajim import gtkgui_helpers
from common import configpaths from gajim.common import configpaths
from dialogs import ErrorDialog, YesNoDialog from gajim.dialogs import ErrorDialog, YesNoDialog
if os.name == 'nt': if os.name == 'nt':
import certifi import certifi

View File

@@ -1,10 +1,10 @@
[info] [info]
name: OMEMO name: OMEMO
short_name: omemo short_name: omemo
version: 2.3.5 version: 2.3.6
description: OMEMO is an XMPP Extension Protocol (XEP) for secure multi-client end-to-end encryption based on Axolotl and PEP. You need to install some dependencys, you can find install instructions for your system in the Github Wiki. description: OMEMO is an XMPP Extension Protocol (XEP) for secure multi-client end-to-end encryption based on Axolotl and PEP. You need to install some dependencys, you can find install instructions for your system in the Github Wiki.
authors: Bahtiar `kalkin-` Gadimov <bahtiar@gadimov.de> authors: Bahtiar `kalkin-` Gadimov <bahtiar@gadimov.de>
Daniel Gultsch <daniel@gultsch.de> Daniel Gultsch <daniel@gultsch.de>
Philipp Hörist <philipp@hoerist.com> Philipp Hörist <philipp@hoerist.com>
homepage: https://dev.gajim.org/gajim/gajim-plugins/wikis/OmemoGajimPlugin homepage: https://dev.gajim.org/gajim/gajim-plugins/wikis/OmemoGajimPlugin
min_gajim_version: 0.16.10 min_gajim_version: 0.16.11

View File

@@ -33,11 +33,11 @@ from gi.repository import GLib
from nbxmpp.simplexml import Node from nbxmpp.simplexml import Node
from nbxmpp import NS_ADDRESS from nbxmpp import NS_ADDRESS
import dialogs from gajim import dialogs
from common import caps_cache, gajim, ged, configpaths from gajim.common import caps_cache, app, ged, configpaths
from common.pep import SUPPORTED_PERSONAL_USER_EVENTS from gajim.common.pep import SUPPORTED_PERSONAL_USER_EVENTS
from plugins import GajimPlugin from gajim.plugins import GajimPlugin
from groupchat_control import GroupchatControl from gajim.groupchat_control import GroupchatControl
from .xmpp import ( from .xmpp import (
NS_NOTIFY, NS_OMEMO, NS_EME, BundleInformationAnnouncement, NS_NOTIFY, NS_OMEMO, NS_EME, BundleInformationAnnouncement,
@@ -45,7 +45,7 @@ from .xmpp import (
DevicelistPEP, OmemoMessage, successful, unpack_device_bundle, DevicelistPEP, OmemoMessage, successful, unpack_device_bundle,
unpack_device_list_update, unpack_encrypted) unpack_device_list_update, unpack_encrypted)
from common.connection_handlers_events import ( from gajim.common.connection_handlers_events import (
MessageReceivedEvent, MamMessageReceivedEvent, MessageNotSentEvent) MessageReceivedEvent, MamMessageReceivedEvent, MessageNotSentEvent)
@@ -58,7 +58,7 @@ PROTOBUF_MISSING = 'OMEMO cant import Google Protobuf, you can find help in ' \
ERROR_MSG = '' ERROR_MSG = ''
NS_HINTS = 'urn:xmpp:hints' NS_HINTS = 'urn:xmpp:hints'
DB_DIR_OLD = gajim.gajimpaths.data_root DB_DIR_OLD = app.gajimpaths.data_root
DB_DIR_NEW = configpaths.gajimpaths['MY_DATA'] DB_DIR_NEW = configpaths.gajimpaths['MY_DATA']
ALLOWED_TAGS = [('request', nbxmpp.NS_RECEIPTS), ALLOWED_TAGS = [('request', nbxmpp.NS_RECEIPTS),
@@ -157,10 +157,10 @@ class OmemoPlugin(GajimPlugin):
self.disabled_accounts.append(account) self.disabled_accounts.append(account)
# add aesgcm:// uri scheme to config # add aesgcm:// uri scheme to config
schemes = gajim.config.get('uri_schemes') schemes = app.config.get('uri_schemes')
if 'aesgcm://' not in schemes.split(): if 'aesgcm://' not in schemes.split():
schemes += ' aesgcm://' schemes += ' aesgcm://'
gajim.config.set('uri_schemes', schemes) app.config.set('uri_schemes', schemes)
def migrate_dbpath(self, account, my_jid): def migrate_dbpath(self, account, my_jid):
old_dbpath = os.path.join(DB_DIR_OLD, 'omemo_' + account + '.db') old_dbpath = os.path.join(DB_DIR_OLD, 'omemo_' + account + '.db')
@@ -193,7 +193,7 @@ class OmemoPlugin(GajimPlugin):
if account in self.disabled_accounts: if account in self.disabled_accounts:
return return
if account not in self.omemo_states: if account not in self.omemo_states:
my_jid = gajim.get_jid_from_account(account) my_jid = app.get_jid_from_account(account)
db_path = self.migrate_dbpath(account, my_jid) db_path = self.migrate_dbpath(account, my_jid)
conn = sqlite3.connect(db_path, check_same_thread=False) conn = sqlite3.connect(db_path, check_same_thread=False)
@@ -245,16 +245,16 @@ class OmemoPlugin(GajimPlugin):
""" """
self.query_for_bundles = [] self.query_for_bundles = []
# Publish bundle information and Entity Caps # Publish bundle information and Entity Caps
for account in gajim.connections: for account in app.connections:
if account in self.disabled_accounts: if account in self.disabled_accounts:
log.debug(account + log.debug(account +
' => Account is disabled') ' => Account is disabled')
continue continue
if NS_NOTIFY not in gajim.gajim_optional_features[account]: if NS_NOTIFY not in app.gajim_optional_features[account]:
gajim.gajim_optional_features[account].append(NS_NOTIFY) app.gajim_optional_features[account].append(NS_NOTIFY)
self._compute_caps_hash(account) self._compute_caps_hash(account)
if account not in self.announced: if account not in self.announced:
if gajim.account_is_connected(account): if app.account_is_connected(account):
log.debug(account + log.debug(account +
' => Announce Support after Plugin Activation') ' => Announce Support after Plugin Activation')
self.announced.append(account) self.announced.append(account)
@@ -266,11 +266,11 @@ class OmemoPlugin(GajimPlugin):
Removes OMEMO from the Entity Capabilities list Removes OMEMO from the Entity Capabilities list
""" """
for account in gajim.connections: for account in app.connections:
if account in self.disabled_accounts: if account in self.disabled_accounts:
continue continue
if NS_NOTIFY in gajim.gajim_optional_features[account]: if NS_NOTIFY in app.gajim_optional_features[account]:
gajim.gajim_optional_features[account].remove(NS_NOTIFY) app.gajim_optional_features[account].remove(NS_NOTIFY)
self._compute_caps_hash(account) self._compute_caps_hash(account)
def activate_encryption(self, chat_control): def activate_encryption(self, chat_control):
@@ -298,7 +298,7 @@ class OmemoPlugin(GajimPlugin):
if isinstance(chat_control, GroupchatControl): if isinstance(chat_control, GroupchatControl):
room = chat_control.room_jid room = chat_control.room_jid
missing = True missing = True
own_jid = gajim.get_jid_from_account(account) own_jid = app.get_jid_from_account(account)
for nick in self.groupchat[room]: for nick in self.groupchat[room]:
real_jid = self.groupchat[room][nick] real_jid = self.groupchat[room][nick]
if real_jid == own_jid: if real_jid == own_jid:
@@ -366,15 +366,15 @@ class OmemoPlugin(GajimPlugin):
@staticmethod @staticmethod
def _compute_caps_hash(account): def _compute_caps_hash(account):
""" Computes the hash for Entity Capabilities and publishes it """ """ Computes the hash for Entity Capabilities and publishes it """
gajim.caps_hash[account] = caps_cache.compute_caps_hash( app.caps_hash[account] = caps_cache.compute_caps_hash(
[gajim.gajim_identity], [app.gajim_identity],
gajim.gajim_common_features + app.gajim_common_features +
gajim.gajim_optional_features[account]) app.gajim_optional_features[account])
# re-send presence with new hash # re-send presence with new hash
connected = gajim.connections[account].connected connected = app.connections[account].connected
if connected > 1 and gajim.SHOW_LIST[connected] != 'invisible': if connected > 1 and app.SHOW_LIST[connected] != 'invisible':
gajim.connections[account].change_status( app.connections[account].change_status(
gajim.SHOW_LIST[connected], gajim.connections[account].status) app.SHOW_LIST[connected], app.connections[account].status)
def message_received(self, conn, obj, callback): def message_received(self, conn, obj, callback):
if obj.encrypted: if obj.encrypted:
@@ -411,7 +411,7 @@ class OmemoPlugin(GajimPlugin):
state = self.get_omemo_state(account) state = self.get_omemo_state(account)
from_jid = str(msg.msg_.getAttr('from')) from_jid = str(msg.msg_.getAttr('from'))
from_jid = gajim.get_jid_without_resource(from_jid) from_jid = app.get_jid_without_resource(from_jid)
msg_dict = unpack_encrypted(omemo_encrypted_tag) msg_dict = unpack_encrypted(omemo_encrypted_tag)
@@ -496,7 +496,7 @@ class OmemoPlugin(GajimPlugin):
msg.encrypted = 'drop' msg.encrypted = 'drop'
return return
else: else:
msg_dict['sender_jid'] = gajim. \ msg_dict['sender_jid'] = app. \
get_jid_without_resource(from_jid) get_jid_without_resource(from_jid)
plaintext = state.decrypt_msg(msg_dict) plaintext = state.decrypt_msg(msg_dict)
@@ -541,7 +541,7 @@ class OmemoPlugin(GajimPlugin):
return return
room = event.room_jid room = event.room_jid
jid = gajim.get_jid_without_resource(event.real_jid) jid = app.get_jid_without_resource(event.real_jid)
nick = event.nick nick = event.nick
if '303' in event.status_code: # Nick Changed if '303' in event.status_code: # Nick Changed
@@ -584,9 +584,9 @@ class OmemoPlugin(GajimPlugin):
log.debug('OMEMO capable Room found: %s', room) log.debug('OMEMO capable Room found: %s', room)
gajim.connections[account].get_affiliation_list(room, 'owner') app.connections[account].get_affiliation_list(room, 'owner')
gajim.connections[account].get_affiliation_list(room, 'admin') app.connections[account].get_affiliation_list(room, 'admin')
gajim.connections[account].get_affiliation_list(room, 'member') app.connections[account].get_affiliation_list(room, 'member')
def gc_config_changed_received(self, event): def gc_config_changed_received(self, event):
account = event.conn.name account = event.conn.name
@@ -626,8 +626,8 @@ class OmemoPlugin(GajimPlugin):
return return
state = self.get_omemo_state(account) state = self.get_omemo_state(account)
to_jid = gajim.get_jid_without_resource(event.jid) to_jid = app.get_jid_without_resource(event.jid)
own_jid = gajim.get_jid_from_account(account) own_jid = app.get_jid_from_account(account)
msg_dict = state.create_gc_msg( msg_dict = state.create_gc_msg(
own_jid, to_jid, event.message.encode('utf8')) own_jid, to_jid, event.message.encode('utf8'))
@@ -636,7 +636,7 @@ class OmemoPlugin(GajimPlugin):
except OMEMOError as error: except OMEMOError as error:
log.error(error) log.error(error)
gajim.nec.push_incoming_event( app.nec.push_incoming_event(
MessageNotSentEvent( MessageNotSentEvent(
None, conn=conn, jid=event.jid, message=event.message, None, conn=conn, jid=event.jid, message=event.message,
error=error, time_=time.time(), session=None)) error=error, time_=time.time(), session=None))
@@ -691,8 +691,8 @@ class OmemoPlugin(GajimPlugin):
return return
state = self.get_omemo_state(account) state = self.get_omemo_state(account)
to_jid = gajim.get_jid_without_resource(event.jid) to_jid = app.get_jid_without_resource(event.jid)
own_jid = gajim.get_jid_from_account(account) own_jid = app.get_jid_from_account(account)
plaintext = event.message.encode('utf8') plaintext = event.message.encode('utf8')
msg_dict = state.create_msg(own_jid, to_jid, plaintext) msg_dict = state.create_msg(own_jid, to_jid, plaintext)
@@ -701,7 +701,7 @@ class OmemoPlugin(GajimPlugin):
except OMEMOError as error: except OMEMOError as error:
log.error(error) log.error(error)
gajim.nec.push_incoming_event( app.nec.push_incoming_event(
MessageNotSentEvent( MessageNotSentEvent(
None, conn=conn, jid=event.jid, message=event.message, None, conn=conn, jid=event.jid, message=event.message,
error=error, time_=time.time(), session=event.session)) error=error, time_=time.time(), session=event.session))
@@ -766,7 +766,7 @@ class OmemoPlugin(GajimPlugin):
devices_list = list(set(unpack_device_list_update(event.stanza, devices_list = list(set(unpack_device_list_update(event.stanza,
event.conn.name))) event.conn.name)))
contact_jid = gajim.get_jid_without_resource(event.fjid) contact_jid = app.get_jid_without_resource(event.fjid)
if not devices_list: if not devices_list:
log.error(account + log.error(account +
' => Received empty or invalid Devicelist from: ' + ' => Received empty or invalid Devicelist from: ' +
@@ -774,7 +774,7 @@ class OmemoPlugin(GajimPlugin):
return False return False
state = self.get_omemo_state(account) state = self.get_omemo_state(account)
my_jid = gajim.get_jid_from_account(account) my_jid = app.get_jid_from_account(account)
if contact_jid == my_jid: if contact_jid == my_jid:
log.info(account + ' => Received own device list:' + str( log.info(account + ' => Received own device list:' + str(
@@ -831,7 +831,7 @@ class OmemoPlugin(GajimPlugin):
log.debug(account + ' => Publishing own Devices: ' + str( log.debug(account + ' => Publishing own Devices: ' + str(
devices_list)) devices_list))
iq = DeviceListAnnouncement(devices_list) iq = DeviceListAnnouncement(devices_list)
gajim.connections[account].connection.send(iq) app.connections[account].connection.send(iq)
id_ = str(iq.getAttr('id')) id_ = str(iq.getAttr('id'))
IQ_CALLBACK[id_] = lambda event: log.debug(event) IQ_CALLBACK[id_] = lambda event: log.debug(event)
@@ -852,7 +852,7 @@ class OmemoPlugin(GajimPlugin):
Returns True if there are no trusted Fingerprints Returns True if there are no trusted Fingerprints
""" """
state = self.get_omemo_state(account) state = self.get_omemo_state(account)
my_jid = gajim.get_jid_from_account(account) my_jid = app.get_jid_from_account(account)
# Fetch Bundles of own other Devices # Fetch Bundles of own other Devices
if my_jid not in self.query_for_bundles: if my_jid not in self.query_for_bundles:
@@ -922,7 +922,7 @@ class OmemoPlugin(GajimPlugin):
lambda stanza: self.session_from_prekey_bundle(account, lambda stanza: self.session_from_prekey_bundle(account,
stanza, jid, stanza, jid,
device_id) device_id)
gajim.connections[account].connection.send(iq) app.connections[account].connection.send(iq)
def session_from_prekey_bundle(self, account, stanza, def session_from_prekey_bundle(self, account, stanza,
recipient_id, device_id): recipient_id, device_id):
@@ -962,7 +962,7 @@ class OmemoPlugin(GajimPlugin):
log.info(account + ' => session created for: ' + recipient_id) log.info(account + ' => session created for: ' + recipient_id)
# Trigger dialog to trust new Fingerprints if # Trigger dialog to trust new Fingerprints if
# the Chat Window is Open # the Chat Window is Open
ctrl = gajim.interface.msg_win_mgr.get_control( ctrl = app.interface.msg_win_mgr.get_control(
recipient_id, account) recipient_id, account)
if ctrl: if ctrl:
self.new_fingerprints_available(ctrl) self.new_fingerprints_available(ctrl)
@@ -975,9 +975,9 @@ class OmemoPlugin(GajimPlugin):
account : str account : str
the account name the account name
""" """
my_jid = gajim.get_jid_from_account(account) my_jid = app.get_jid_from_account(account)
iq = DevicelistQuery(my_jid) iq = DevicelistQuery(my_jid)
gajim.connections[account].connection.send(iq) app.connections[account].connection.send(iq)
log.info(account + ' => Querry own devicelist ...') log.info(account + ' => Querry own devicelist ...')
id_ = str(iq.getAttr("id")) id_ = str(iq.getAttr("id"))
IQ_CALLBACK[id_] = lambda stanza: \ IQ_CALLBACK[id_] = lambda stanza: \
@@ -998,7 +998,7 @@ class OmemoPlugin(GajimPlugin):
""" """
state = self.get_omemo_state(account) state = self.get_omemo_state(account)
iq = BundleInformationAnnouncement(state.bundle, state.own_device_id) iq = BundleInformationAnnouncement(state.bundle, state.own_device_id)
gajim.connections[account].connection.send(iq) app.connections[account].connection.send(iq)
id_ = str(iq.getAttr("id")) id_ = str(iq.getAttr("id"))
log.info(account + " => Publishing bundle ...") log.info(account + " => Publishing bundle ...")
IQ_CALLBACK[id_] = lambda stanza: \ IQ_CALLBACK[id_] = lambda stanza: \
@@ -1031,7 +1031,7 @@ class OmemoPlugin(GajimPlugin):
The stanza object received from callback The stanza object received from callback
""" """
my_jid = gajim.get_jid_from_account(account) my_jid = app.get_jid_from_account(account)
state = self.get_omemo_state(account) state = self.get_omemo_state(account)
if successful(stanza): if successful(stanza):
@@ -1069,7 +1069,7 @@ class OmemoPlugin(GajimPlugin):
account : str account : str
the account name the account name
""" """
connection = gajim.connections[account].connection connection = app.connections[account].connection
if not connection: if not connection:
return return
state = self.get_omemo_state(account) state = self.get_omemo_state(account)

View File

@@ -38,10 +38,10 @@ except ImportError as error:
log.debug(error) log.debug(error)
log.error('python-qrcode or dependencies of it are not available') log.error('python-qrcode or dependencies of it are not available')
from common import gajim from gajim.common import app
from common import configpaths from gajim.common import configpaths
from dialogs import YesNoDialog from gajim.dialogs import YesNoDialog
from plugins.gui import GajimPluginConfigDialog from gajim.plugins.gui import GajimPluginConfigDialog
@unique @unique
@@ -88,7 +88,7 @@ class OMEMOConfigDialog(GajimPluginConfigDialog):
self.plugin_active = False self.plugin_active = False
def on_run(self): def on_run(self):
for plugin in gajim.plugin_manager.active_plugins: for plugin in app.plugin_manager.active_plugins:
log.debug(type(plugin)) log.debug(type(plugin))
if type(plugin).__name__ == 'OmemoPlugin': if type(plugin).__name__ == 'OmemoPlugin':
self.plugin_active = True self.plugin_active = True
@@ -104,7 +104,7 @@ class OMEMOConfigDialog(GajimPluginConfigDialog):
return False return False
def update_account_store(self): def update_account_store(self):
for account in sorted(gajim.contacts.get_accounts()): for account in sorted(app.contacts.get_accounts()):
if account not in self.disabled_accounts and \ if account not in self.disabled_accounts and \
not self.is_in_accountstore(account): not self.is_in_accountstore(account):
self.account_store.append(row=(account,)) self.account_store.append(row=(account,))
@@ -358,7 +358,7 @@ class OMEMOConfigDialog(GajimPluginConfigDialog):
# Set QR Verification Code # Set QR Verification Code
if PILLOW: if PILLOW:
path = self.get_qrcode( path = self.get_qrcode(
gajim.get_jid_from_account(account), deviceid, ownfpr[2:]) app.get_jid_from_account(account), deviceid, ownfpr[2:])
self.qrcode.set_from_pixbuf(GdkPixbuf.Pixbuf.new_from_file(path)) self.qrcode.set_from_pixbuf(GdkPixbuf.Pixbuf.new_from_file(path))
self.qrinfo.hide() self.qrinfo.hide()
else: else:
@@ -374,7 +374,7 @@ class FingerprintWindow(Gtk.Dialog):
self.account = self.contact.account.name self.account = self.contact.account.name
self.plugin = plugin self.plugin = plugin
self.omemostate = self.plugin.get_omemo_state(self.account) self.omemostate = self.plugin.get_omemo_state(self.account)
self.own_jid = gajim.get_jid_from_account(self.account) self.own_jid = app.get_jid_from_account(self.account)
Gtk.Dialog.__init__(self, Gtk.Dialog.__init__(self,
title=('Fingerprints for %s') % contact.jid, title=('Fingerprints for %s') % contact.jid,
parent=parent, parent=parent,

View File

@@ -28,9 +28,9 @@ from base64 import b64decode, b64encode
from nbxmpp.protocol import NS_PUBSUB, Iq from nbxmpp.protocol import NS_PUBSUB, Iq
from nbxmpp.simplexml import Node from nbxmpp.simplexml import Node
from common import gajim # pylint: disable=import-error from gajim.common import app # pylint: disable=import-error
from common.pep import AbstractPEP # pylint: disable=import-error from gajim.common.pep import AbstractPEP # pylint: disable=import-error
from plugins.helpers import log_calls # pylint: disable=import-error from gajim.plugins.helpers import log_calls # pylint: disable=import-error
NS_PUBSUB_EVENT = NS_PUBSUB + '#event' NS_PUBSUB_EVENT = NS_PUBSUB + '#event'
@@ -60,7 +60,7 @@ class DeviceListAnnouncement(Iq):
def __init__(self, device_list): def __init__(self, device_list):
assert isinstance(device_list, list) assert isinstance(device_list, list)
assert len(device_list) > 0 assert len(device_list) > 0
id_ = gajim.get_an_id() id_ = app.get_an_id()
attrs = {'id': id_} attrs = {'id': id_}
Iq.__init__(self, typ='set', attrs=attrs) Iq.__init__(self, typ='set', attrs=attrs)
@@ -96,7 +96,7 @@ class OmemoMessage(Node):
class BundleInformationQuery(Iq): class BundleInformationQuery(Iq):
def __init__(self, contact_jid, device_id): def __init__(self, contact_jid, device_id):
assert isinstance(device_id, int) assert isinstance(device_id, int)
id_ = gajim.get_an_id() id_ = app.get_an_id()
attrs = {'id': id_} attrs = {'id': id_}
Iq.__init__(self, typ='get', attrs=attrs, to=contact_jid) Iq.__init__(self, typ='get', attrs=attrs, to=contact_jid)
items = Node('items', attrs={'node': NS_BUNDLES + str(device_id)}) items = Node('items', attrs={'node': NS_BUNDLES + str(device_id)})
@@ -106,7 +106,7 @@ class BundleInformationQuery(Iq):
class BundleInformationAnnouncement(Iq): class BundleInformationAnnouncement(Iq):
def __init__(self, state_bundle, device_id): def __init__(self, state_bundle, device_id):
id_ = gajim.get_an_id() id_ = app.get_an_id()
attrs = {'id': id_} attrs = {'id': id_}
Iq.__init__(self, typ='set', attrs=attrs) Iq.__init__(self, typ='set', attrs=attrs)
bundle_node = self.make_bundle_node(state_bundle) bundle_node = self.make_bundle_node(state_bundle)
@@ -139,7 +139,7 @@ class BundleInformationAnnouncement(Iq):
class DevicelistQuery(Iq): class DevicelistQuery(Iq):
def __init__(self, contact_jid,): def __init__(self, contact_jid,):
id_ = gajim.get_an_id() id_ = app.get_an_id()
attrs = {'id': id_} attrs = {'id': id_}
Iq.__init__(self, typ='get', attrs=attrs, to=contact_jid) Iq.__init__(self, typ='get', attrs=attrs, to=contact_jid)
items = Node('items', attrs={'node': NS_DEVICE_LIST}) items = Node('items', attrs={'node': NS_DEVICE_LIST})

View File

@@ -1,8 +1,8 @@
[info] [info]
name: PGP name: PGP
short_name: PGP short_name: PGP
version: 1.1.1 version: 1.2.0
description: PGP encryption as per XEP-0027 description: PGP encryption as per XEP-0027
authors: Philipp Hörist <philipp@hoerist.com> authors: Philipp Hörist <philipp@hoerist.com>
homepage: https://dev.gajim.org/gajim/gajim-plugins/wikis/pgpplugin homepage: https://dev.gajim.org/gajim/gajim-plugins/wikis/pgpplugin
min_gajim_version: 0.16.10 min_gajim_version: 0.16.11

View File

@@ -27,16 +27,16 @@ import queue
import nbxmpp import nbxmpp
from gi.repository import GLib from gi.repository import GLib
import dialogs from gajim import dialogs
from common import gajim from gajim.common import app
from common.connection_handlers_events import ( from gajim.common.connection_handlers_events import (
MessageNotSentEvent, MessageReceivedEvent) MessageNotSentEvent, MessageReceivedEvent)
from plugins import GajimPlugin from gajim.plugins import GajimPlugin
log = logging.getLogger('gajim.plugin_system.oldpgp') log = logging.getLogger('gajim.plugin_system.oldpgp')
ERROR_MSG = '' ERROR_MSG = ''
if not gajim.HAVE_GPG: if not app.HAVE_GPG:
ERROR_MSG = 'Please install python-gnupg' ERROR_MSG = 'Please install python-gnupg'
ALLOWED_TAGS = [('request', nbxmpp.NS_RECEIPTS), ALLOWED_TAGS = [('request', nbxmpp.NS_RECEIPTS),
@@ -75,7 +75,7 @@ class OldPGPPlugin(GajimPlugin):
self.thread = None self.thread = None
def get_gpg(self, account): def get_gpg(self, account):
return gajim.connections[account].gpg return app.connections[account].gpg
def activate(self): def activate(self):
pass pass
@@ -112,7 +112,7 @@ class OldPGPPlugin(GajimPlugin):
_('No OpenPGP key is assigned to this contact. So you cannot ' _('No OpenPGP key is assigned to this contact. So you cannot '
'encrypt messages with OpenPGP.')) 'encrypt messages with OpenPGP.'))
chat_control.sendmessage = False chat_control.sendmessage = False
elif not gajim.config.get_per('accounts', account, 'keyid'): elif not app.config.get_per('accounts', account, 'keyid'):
dialogs.ErrorDialog( dialogs.ErrorDialog(
_('No OpenPGP key assigned'), _('No OpenPGP key assigned'),
_('No OpenPGP key is assigned to your account. So you cannot ' _('No OpenPGP key is assigned to your account. So you cannot '
@@ -140,7 +140,7 @@ class OldPGPPlugin(GajimPlugin):
enc_tag = obj.msg_.getTag('x', namespace=nbxmpp.NS_ENCRYPTED) enc_tag = obj.msg_.getTag('x', namespace=nbxmpp.NS_ENCRYPTED)
if enc_tag: if enc_tag:
encmsg = enc_tag.getData() encmsg = enc_tag.getData()
key_id = gajim.config.get_per('accounts', account, 'keyid') key_id = app.config.get_per('accounts', account, 'keyid')
if key_id: if key_id:
obj.encrypted = self.encryption_name obj.encrypted = self.encryption_name
self.decrypt_queue.put([encmsg, key_id, obj, conn, callback]) self.decrypt_queue.put([encmsg, key_id, obj, conn, callback])
@@ -180,7 +180,7 @@ class OldPGPPlugin(GajimPlugin):
error = _('The contact\'s key (%s) does not match the key assigned ' error = _('The contact\'s key (%s) does not match the key assigned '
'in Gajim.' % obj.keyID[:8]) 'in Gajim.' % obj.keyID[:8])
else: else:
my_key_id = gajim.config.get_per('accounts', account, 'keyid') my_key_id = app.config.get_per('accounts', account, 'keyid')
key_list = [obj.keyID, my_key_id] key_list = [obj.keyID, my_key_id]
def _on_encrypted(output): def _on_encrypted(output):
@@ -189,7 +189,7 @@ class OldPGPPlugin(GajimPlugin):
def on_yes(checked): def on_yes(checked):
if checked: if checked:
obj.conn.gpg.always_trust.append(obj.keyID) obj.conn.gpg.always_trust.append(obj.keyID)
gajim.thread_interface( app.thread_interface(
self.get_gpg(account).encrypt, self.get_gpg(account).encrypt,
[obj.message, key_list, True], [obj.message, key_list, True],
_on_encrypted, []) _on_encrypted, [])
@@ -210,7 +210,7 @@ class OldPGPPlugin(GajimPlugin):
self._finished_encrypt( self._finished_encrypt(
obj, msgenc=msgenc, error=error, conn=conn, obj, msgenc=msgenc, error=error, conn=conn,
callback=callback) callback=callback)
gajim.thread_interface( app.thread_interface(
self.get_gpg(account).encrypt, self.get_gpg(account).encrypt,
[obj.message, key_list, False], [obj.message, key_list, False],
_on_encrypted, []) _on_encrypted, [])
@@ -221,7 +221,7 @@ class OldPGPPlugin(GajimPlugin):
conn=None, callback=None): conn=None, callback=None):
if error: if error:
log.error('python-gnupg error: %s', error) log.error('python-gnupg error: %s', error)
gajim.nec.push_incoming_event( app.nec.push_incoming_event(
MessageNotSentEvent( MessageNotSentEvent(
None, conn=conn, jid=obj.jid, message=obj.message, None, conn=conn, jid=obj.jid, message=obj.message,
error=error, time_=time.time(), session=obj.session)) error=error, time_=time.time(), session=obj.session))
@@ -252,7 +252,7 @@ class OldPGPPlugin(GajimPlugin):
thread.start() thread.start()
def _encrypt_file_thread(self, file, account, callback): def _encrypt_file_thread(self, file, account, callback):
my_key_id = gajim.config.get_per('accounts', account, 'keyid') my_key_id = app.config.get_per('accounts', account, 'keyid')
key_list = [file.control.contact.keyID, my_key_id] key_list = [file.control.contact.keyID, my_key_id]
encrypted = self.get_gpg(account).encrypt_file(file.get_data(), key_list) encrypted = self.get_gpg(account).encrypt_file(file.get_data(), key_list)
@@ -306,7 +306,7 @@ def check_state(key_id, account):
info = _('No OpenPGP key is assigned to this contact. So you cannot' info = _('No OpenPGP key is assigned to this contact. So you cannot'
' encrypt messages.') ' encrypt messages.')
else: else:
error = gajim.connections[account].gpg.encrypt('test', [key_id])[1] error = app.connections[account].gpg.encrypt('test', [key_id])[1]
if error: if error:
verification_status = _('''Contact's identity NOT verified''') verification_status = _('''Contact's identity NOT verified''')
info = _('OpenPGP key is assigned to this contact, but <b>you ' info = _('OpenPGP key is assigned to this contact, but <b>you '

View File

@@ -1,8 +1,8 @@
[info] [info]
name: Plugins translations name: Plugins translations
short_name: plugins_translations short_name: plugins_translations
version: 0.6.5 version: 0.6.6
description: This plugin contains translation files for Gajim plugins description: This plugin contains translation files for Gajim plugins
authors = Denis Fomin <fominde@gmail.com> authors = Denis Fomin <fominde@gmail.com>
homepage = http://trac-plugins.gajim.org/wiki/PluginsTranslationsPlugin homepage = http://trac-plugins.gajim.org/wiki/PluginsTranslationsPlugin
min_gajim_version: 0.16.10 min_gajim_version: 0.16.11

View File

@@ -3,10 +3,10 @@
import os import os
from common import gajim from gajim.common import app
from plugins import GajimPlugin from gajim.plugins import GajimPlugin
from plugins.helpers import log_calls from gajim.plugins.helpers import log_calls
from plugins.plugins_i18n import _ from gajim.plugins.plugins_i18n import _
class PluginsTranslationsPlugin(GajimPlugin): class PluginsTranslationsPlugin(GajimPlugin):
@@ -17,7 +17,7 @@ class PluginsTranslationsPlugin(GajimPlugin):
'for Gajim plugins') 'for Gajim plugins')
self.config_dialog = None self.config_dialog = None
self.config_default_values = {'last_version': '0'} self.config_default_values = {'last_version': '0'}
self.locale_dir = os.path.join(gajim.PLUGINS_DIRS[1], 'locale') self.locale_dir = os.path.join(app.PLUGINS_DIRS[1], 'locale')
@log_calls('PluginsTranslationsPlugin') @log_calls('PluginsTranslationsPlugin')
def activate(self): def activate(self):

View File

@@ -1,8 +1,8 @@
[info] [info]
name: Quick replies name: Quick replies
short_name: quick_replies short_name: quick_replies
version: 0.0.2 version: 0.0.3
description: Plugin for quick insert template message and add your own template messages description: Plugin for quick insert template message and add your own template messages
authors = Evgeniy Popov <evgeniypopov@gmail.com> authors = Evgeniy Popov <evgeniypopov@gmail.com>
homepage = http://trac-plugins.gajim.org/wiki/QuickRepliesPlugin homepage = http://trac-plugins.gajim.org/wiki/QuickRepliesPlugin
mix_gajim_version: 0.16.10 mix_gajim_version: 0.16.11

View File

@@ -1,12 +1,12 @@
from gi.repository import Gtk from gi.repository import Gtk
from gi.repository import GdkPixbuf from gi.repository import GdkPixbuf
import gtkgui_helpers from gajim import gtkgui_helpers
from common import gajim from gajim.common import app
from plugins import GajimPlugin from gajim.plugins import GajimPlugin
from plugins.gui import GajimPluginConfigDialog from gajim.plugins.gui import GajimPluginConfigDialog
from plugins.helpers import log_calls from gajim.plugins.helpers import log_calls
class QuickRepliesPlugin(GajimPlugin): class QuickRepliesPlugin(GajimPlugin):
@@ -56,7 +56,7 @@ class QuickRepliesPlugin(GajimPlugin):
if base.chat_control != chat_control: if base.chat_control != chat_control:
continue continue
base.button.set_sensitive(chat_control.contact.show != 'offline' \ base.button.set_sensitive(chat_control.contact.show != 'offline' \
and gajim.connections[chat_control.account].connected > 0) and app.connections[chat_control.account].connected > 0)
class Base(object): class Base(object):

View File

@@ -1,8 +1,8 @@
[info] [info]
name: Regex Filter name: Regex Filter
short_name: regex_filter short_name: regex_filter
version: 0.3 version: 0.4
description: Filter incoming messages using regex. description: Filter incoming messages using regex.
authors: Yann Leboulanger <asterix@lagaule.org> authors: Yann Leboulanger <asterix@lagaule.org>
homepage: http://trac-plugins.gajim.org/wiki/RegexFilterPlugin homepage: http://trac-plugins.gajim.org/wiki/RegexFilterPlugin
min_gajim_version: 0.16.10 min_gajim_version: 0.16.11

View File

@@ -26,13 +26,13 @@ Regex Filter plugin.
import re import re
from plugins import GajimPlugin from gajim.plugins import GajimPlugin
from plugins.helpers import log, log_calls from gajim.plugins.helpers import log, log_calls
from common import gajim from gajim.common import app
from common import ged from gajim.common import ged
from command_system.framework import CommandContainer, command, doc from gajim.command_system.framework import CommandContainer, command, doc
from command_system.implementation.hosts import * from gajim.command_system.implementation.hosts import *
class RegexFilterPlugin(GajimPlugin): class RegexFilterPlugin(GajimPlugin):
@@ -109,7 +109,7 @@ class FilterCommands(CommandContainer):
@doc(_("Add an incoming filter. First argument is the search regex, " @doc(_("Add an incoming filter. First argument is the search regex, "
"second argument is the replace regex.")) "second argument is the replace regex."))
def add_filter(self, search, replace): def add_filter(self, search, replace):
plugin = gajim.plugin_manager.get_active_plugin('regex_filter') plugin = app.plugin_manager.get_active_plugin('regex_filter')
plugin.add_rule(search, replace) plugin.add_rule(search, replace)
return _('Added rule to replace %s by %s' % (search, replace)) return _('Added rule to replace %s by %s' % (search, replace))
@@ -117,7 +117,7 @@ class FilterCommands(CommandContainer):
@doc(_("Remove an incoming filter. Argument is the rule number. " @doc(_("Remove an incoming filter. Argument is the rule number. "
"See /list_rules command.")) "See /list_rules command."))
def remove_filter(self, num): def remove_filter(self, num):
plugin = gajim.plugin_manager.get_active_plugin('regex_filter') plugin = app.plugin_manager.get_active_plugin('regex_filter')
if plugin.remove_rule(num): if plugin.remove_rule(num):
return _('Rule number %s removed' % num) return _('Rule number %s removed' % num)
return _('Rule number %s does not exist' % num) return _('Rule number %s does not exist' % num)
@@ -125,7 +125,7 @@ class FilterCommands(CommandContainer):
@command("list_filters") @command("list_filters")
@doc(_("List incoming filters.")) @doc(_("List incoming filters."))
def list_filters(self): def list_filters(self):
plugin = gajim.plugin_manager.get_active_plugin('regex_filter') plugin = app.plugin_manager.get_active_plugin('regex_filter')
rules = plugin.get_rules() rules = plugin.get_rules()
st = '' st = ''
for num, rule in rules.items(): for num, rule in rules.items():

View File

@@ -1,9 +1,9 @@
[info] [info]
name: Roster Tweaks name: Roster Tweaks
short_name: roster_tweaks short_name: roster_tweaks
version: 0.6.3 version: 0.6.4
description: Allows user to tweak roster window appearance (eg. make it compact). description: Allows user to tweak roster window appearance (eg. make it compact).
Added ability to quickly change the status message to all connected accounts. Added ability to quickly change the status message to all connected accounts.
authors = Denis Fomin <fominde@gmail.com> authors = Denis Fomin <fominde@gmail.com>
homepage = http://trac-plugins.gajim.org/wiki/RosterTweaksPlugin homepage = http://trac-plugins.gajim.org/wiki/RosterTweaksPlugin
min_gajim_version: 0.16.10 min_gajim_version: 0.16.11

View File

@@ -5,12 +5,12 @@ from gi.repository import Gtk
from gi.repository import Gdk from gi.repository import Gdk
from gi.repository import GObject from gi.repository import GObject
from common import gajim, ged, helpers, pep from gajim.common import app, ged, helpers, pep
from plugins import GajimPlugin from gajim.plugins import GajimPlugin
from plugins.helpers import log_calls from gajim.plugins.helpers import log_calls
from plugins.gui import GajimPluginConfigDialog from gajim.plugins.gui import GajimPluginConfigDialog
from dialogs import ChangeActivityDialog, ChangeMoodDialog from gajim.dialogs import ChangeActivityDialog, ChangeMoodDialog
import gtkgui_helpers from gajim import gtkgui_helpers
class RosterTweaksPlugin(GajimPlugin): class RosterTweaksPlugin(GajimPlugin):
@@ -34,7 +34,7 @@ class RosterTweaksPlugin(GajimPlugin):
self.gui_extension_points = { self.gui_extension_points = {
'roster_draw_contact': (self.roster_draw_contact, 'roster_draw_contact': (self.roster_draw_contact,
self.disconnect_roster_draw_contact),} self.disconnect_roster_draw_contact),}
self.roster = gajim.interface.roster self.roster = app.interface.roster
self.config_dialog = RosterTweaksPluginConfigDialog(self) self.config_dialog = RosterTweaksPluginConfigDialog(self)
def roster_draw_contact(self, roster,jid, account, contact): def roster_draw_contact(self, roster,jid, account, contact):
@@ -57,10 +57,10 @@ class RosterTweaksPlugin(GajimPlugin):
self.connected = False self.connected = False
def pep_received(self, obj): def pep_received(self, obj):
if obj.jid != gajim.get_jid_from_account(obj.conn.name): if obj.jid != app.get_jid_from_account(obj.conn.name):
return return
pep_dict = gajim.connections[obj.conn.name].pep pep_dict = app.connections[obj.conn.name].pep
if obj.pep_type == 'mood': if obj.pep_type == 'mood':
img = self.xml.get_object('mood_image') img = self.xml.get_object('mood_image')
if 'mood' in pep_dict: if 'mood' in pep_dict:
@@ -78,7 +78,7 @@ class RosterTweaksPlugin(GajimPlugin):
def our_show(self, obj): def our_show(self, obj):
if self.active: if self.active:
if helpers.get_global_show() != gajim.SHOW_LIST[0]: if helpers.get_global_show() != app.SHOW_LIST[0]:
self.status_widget.set_text(helpers.get_global_status()) self.status_widget.set_text(helpers.get_global_status())
else: else:
self.status_widget.set_text('') self.status_widget.set_text('')
@@ -145,13 +145,13 @@ class RosterTweaksPlugin(GajimPlugin):
def status_changed(self, widget, event): def status_changed(self, widget, event):
if event.keyval == gtk.keysyms.Return or \ if event.keyval == gtk.keysyms.Return or \
event.keyval == gtk.keysyms.KP_Enter: event.keyval == gtk.keysyms.KP_Enter:
accounts = gajim.connections.keys() accounts = app.connections.keys()
message = widget.get_text() message = widget.get_text()
for account in accounts: for account in accounts:
if not gajim.account_is_connected(account): if not app.account_is_connected(account):
continue continue
current_show = gajim.SHOW_LIST[ current_show = app.SHOW_LIST[
gajim.connections[account].connected] app.connections[account].connected]
self.roster.send_status(account, current_show, message) self.roster.send_status(account, current_show, message)
self.font_desc.set_weight(pango.WEIGHT_BOLD) self.font_desc.set_weight(pango.WEIGHT_BOLD)
widget.modify_font(self.font_desc) widget.modify_font(self.font_desc)
@@ -177,9 +177,9 @@ class RosterTweaksPlugin(GajimPlugin):
self.pep_dict.get('mood_text', None)) self.pep_dict.get('mood_text', None))
def send_pep(self): def send_pep(self):
accounts = gajim.connections.keys() accounts = app.connections.keys()
for account in accounts: for account in accounts:
if gajim.account_is_connected(account): if app.account_is_connected(account):
self.roster.send_pep(account, self.pep_dict) self.roster.send_pep(account, self.pep_dict)

View File

@@ -1,10 +1,10 @@
[info] [info]
name: Server Status Icons name: Server Status Icons
short_name: server_status_icons short_name: server_status_icons
version: 0.1.3 version: 0.1.4
description: Replace standard Gajim status icons with server description: Replace standard Gajim status icons with server
specific for known XMPP server accounts (vk.com, ...) specific for known XMPP server accounts (vk.com, ...)
authors = Denis Fomin <fominde@gmail.com> authors = Denis Fomin <fominde@gmail.com>
Pavel Suslov Pavel Suslov
homepage = http://trac-plugins.gajim.org/wiki/ServerStatusIconsPlugin homepage = http://trac-plugins.gajim.org/wiki/ServerStatusIconsPlugin
min_gajim_version: 0.16.10 min_gajim_version: 0.16.11

View File

@@ -2,13 +2,13 @@
## ##
import os import os
from plugins.gui import GajimPluginConfigDialog from gajim.plugins.gui import GajimPluginConfigDialog
from plugins import GajimPlugin from gajim.plugins import GajimPlugin
from plugins.helpers import log_calls from gajim.plugins.helpers import log_calls
import gtkgui_helpers from gajim import gtkgui_helpers
from common import gajim from gajim.common import app
from common import helpers from gajim.common import helpers
from common import ged from gajim.common import ged
class ServerStatusIconsPlugin(GajimPlugin): class ServerStatusIconsPlugin(GajimPlugin):
@@ -33,7 +33,7 @@ class ServerStatusIconsPlugin(GajimPlugin):
def connect_with_roster_draw_contact(self, roster, jid, account, contact): def connect_with_roster_draw_contact(self, roster, jid, account, contact):
if not self.active: if not self.active:
return return
if gajim.jid_is_transport(jid): if app.jid_is_transport(jid):
return return
child_iters = roster._get_contact_iter(jid, account, contact, child_iters = roster._get_contact_iter(jid, account, contact,
@@ -42,7 +42,7 @@ class ServerStatusIconsPlugin(GajimPlugin):
return return
icon_name = helpers.get_icon_name_to_show(contact, account) icon_name = helpers.get_icon_name_to_show(contact, account)
if gajim.events.get_events(account, jid) or icon_name == 'requested': if app.events.get_events(account, jid) or icon_name == 'requested':
return return
host = jid.split('@')[1] host = jid.split('@')[1]
@@ -79,22 +79,22 @@ class ServerStatusIconsPlugin(GajimPlugin):
def _nec_our_show(self, obj): def _nec_our_show(self, obj):
account = obj.conn.name account = obj.conn.name
roster = gajim.interface.roster roster = app.interface.roster
status = gajim.connections[account].connected status = app.connections[account].connected
if account not in gajim.contacts.get_accounts(): if account not in app.contacts.get_accounts():
return return
child_iterA = roster._get_account_iter(account, roster.model) child_iterA = roster._get_account_iter(account, roster.model)
if not child_iterA: if not child_iterA:
return return
hostname = gajim.config.get_per('accounts', account, 'hostname') hostname = app.config.get_per('accounts', account, 'hostname')
server = self.known_servers.get(hostname, False) server = self.known_servers.get(hostname, False)
if not server: if not server:
return return
if not roster.regroup: if not roster.regroup:
show = gajim.SHOW_LIST[status] show = app.SHOW_LIST[status]
else: # accounts merged else: # accounts merged
show = helpers.get_global_show() show = helpers.get_global_show()
@@ -114,13 +114,13 @@ class ServerStatusIconsPlugin(GajimPlugin):
@log_calls('ServerStatusIconsPlugin') @log_calls('ServerStatusIconsPlugin')
def activate(self): def activate(self):
self.active = True self.active = True
gajim.interface.roster.setup_and_draw_roster() app.interface.roster.setup_and_draw_roster()
gajim.ged.register_event_handler('our-show', ged.GUI2, app.ged.register_event_handler('our-show', ged.GUI2,
self._nec_our_show) self._nec_our_show)
@log_calls('ServerStatusIconsPlugin') @log_calls('ServerStatusIconsPlugin')
def deactivate(self): def deactivate(self):
self.active = None self.active = None
gajim.ged.remove_event_handler('our-show', ged.GUI2, app.ged.remove_event_handler('our-show', ged.GUI2,
self._nec_our_show) self._nec_our_show)
gajim.interface.roster.setup_and_draw_roster() app.interface.roster.setup_and_draw_roster()

View File

@@ -1,9 +1,9 @@
[info] [info]
name: Set Location name: Set Location
short_name: set_location short_name: set_location
version: 0.7.2 version: 0.7.3
description: Set information about the current geographical or physical location. description: Set information about the current geographical or physical location.
To be able to specify a location on the built-in card, you must install gir1.2-gtkchamplain To be able to specify a location on the built-in card, you must install gir1.2-gtkchamplain
authors: Denis Fomin <fominde@gmail.com> authors: Denis Fomin <fominde@gmail.com>
homepage: http://trac-plugins.gajim.org/wiki/SetLocalitionPlugin homepage: http://trac-plugins.gajim.org/wiki/SetLocalitionPlugin
min_gajim_version: 0.16.10 min_gajim_version: 0.16.11

View File

@@ -7,14 +7,14 @@ from gi.repository import GdkPixbuf
import os import os
import time import time
from plugins.gui import GajimPluginConfigDialog from gajim.plugins.gui import GajimPluginConfigDialog
from plugins import GajimPlugin from gajim.plugins import GajimPlugin
from plugins.helpers import log_calls from gajim.plugins.helpers import log_calls
from common import gajim from gajim.common import app
from common import ged from gajim.common import ged
from common import helpers from gajim.common import helpers
import gtkgui_helpers from gajim import gtkgui_helpers
from dialogs import InputDialog, WarningDialog from gajim.dialogs import InputDialog, WarningDialog
class SetLocationPlugin(GajimPlugin): class SetLocationPlugin(GajimPlugin):
@@ -46,16 +46,16 @@ class SetLocationPlugin(GajimPlugin):
@log_calls('SetLocationPlugin') @log_calls('SetLocationPlugin')
def activate(self): def activate(self):
gajim.ged.register_event_handler('signed-in', ged.POSTGUI, app.ged.register_event_handler('signed-in', ged.POSTGUI,
self.on_signed_in) self.on_signed_in)
self.send_locations() self.send_locations()
@log_calls('SetLocationPlugin') @log_calls('SetLocationPlugin')
def deactivate(self): def deactivate(self):
self._data = {} self._data = {}
for acct in gajim.connections: for acct in app.connections:
gajim.connections[acct].send_location(self._data) app.connections[acct].send_location(self._data)
gajim.ged.remove_event_handler('signed-in', ged.POSTGUI, app.ged.remove_event_handler('signed-in', ged.POSTGUI,
self.on_signed_in) self.on_signed_in)
def on_signed_in(self, network_event): def on_signed_in(self, network_event):
@@ -72,11 +72,11 @@ class SetLocationPlugin(GajimPlugin):
if not acct: if not acct:
#set geo for all accounts #set geo for all accounts
for acct in gajim.connections: for acct in app.connections:
if gajim.config.get_per('accounts', acct, 'publish_location'): if app.config.get_per('accounts', acct, 'publish_location'):
gajim.connections[acct].send_location(self._data) app.connections[acct].send_location(self._data)
elif gajim.config.get_per('accounts', acct, 'publish_location'): elif app.config.get_per('accounts', acct, 'publish_location'):
gajim.connections[acct].send_location(self._data) app.connections[acct].send_location(self._data)
class SetLocationPluginConfigDialog(GajimPluginConfigDialog): class SetLocationPluginConfigDialog(GajimPluginConfigDialog):
@@ -234,9 +234,9 @@ class SetLocationPluginConfigDialog(GajimPluginConfigDialog):
def show_contacts(self): def show_contacts(self):
from gi.repository import Champlain, Clutter from gi.repository import Champlain, Clutter
data = {} data = {}
accounts = gajim.contacts._accounts accounts = app.contacts._accounts
for account in accounts: for account in accounts:
if not gajim.account_is_connected(account): if not app.account_is_connected(account):
continue continue
for contact in accounts[account].contacts._contacts: for contact in accounts[account].contacts._contacts:
pep = accounts[account].contacts._contacts[contact][0].pep pep = accounts[account].contacts._contacts[contact][0].pep
@@ -276,7 +276,7 @@ class SetLocationPluginConfigDialog(GajimPluginConfigDialog):
if jid: if jid:
# we want an avatar # we want an avatar
puny_jid = helpers.sanitize_filename(jid) puny_jid = helpers.sanitize_filename(jid)
path_to_file = os.path.join(gajim.AVATAR_PATH, puny_jid) + suffix path_to_file = os.path.join(app.AVATAR_PATH, puny_jid) + suffix
path_to_local_file = path_to_file + '_local' path_to_local_file = path_to_file + '_local'
for extension in ('.png', '.jpeg'): for extension in ('.png', '.jpeg'):
path_to_local_file_full = path_to_local_file + extension path_to_local_file_full = path_to_local_file + extension

View File

@@ -1,9 +1,9 @@
[info] [info]
name: Url image preview name: Url image preview
short_name: url_image_preview short_name: url_image_preview
version: 0.5.5 version: 0.5.6
description: Url image preview in chatbox. description: Url image preview in chatbox.
authors = Denis Fomin <fominde@gmail.com> authors = Denis Fomin <fominde@gmail.com>
Yann Leboulanger <asterix@lagaule.org> Yann Leboulanger <asterix@lagaule.org>
homepage = http://trac-plugins.gajim.org/wiki/UrlImagePreviewPlugin homepage = http://trac-plugins.gajim.org/wiki/UrlImagePreviewPlugin
min_gajim_version: 0.16.10 min_gajim_version: 0.16.11

View File

@@ -5,12 +5,12 @@ from gi.repository import GdkPixbuf
import re import re
import os import os
from common import gajim from gajim.common import app
from common import helpers from gajim.common import helpers
from plugins import GajimPlugin from gajim.plugins import GajimPlugin
from plugins.helpers import log_calls from gajim.plugins.helpers import log_calls
from plugins.gui import GajimPluginConfigDialog from gajim.plugins.gui import GajimPluginConfigDialog
from conversation_textview import TextViewImage from gajim.conversation_textview import TextViewImage
EXTENSIONS = ('.png','.jpg','.jpeg','.gif','.raw','.svg') EXTENSIONS = ('.png','.jpg','.jpeg','.gif','.raw','.svg')
@@ -66,7 +66,7 @@ class Base(object):
self.textview = self.chat_control.conv_textview self.textview = self.chat_control.conv_textview
def print_special_text(self, special_text, other_tags, graphics=True): def print_special_text(self, special_text, other_tags, graphics=True):
if not gajim.interface.basic_pattern_re.match(special_text): if not app.interface.basic_pattern_re.match(special_text):
return return
# remove qip bbcode # remove qip bbcode
special_text = special_text.rsplit('[/img]')[0] special_text = special_text.rsplit('[/img]')[0]
@@ -86,7 +86,7 @@ class Base(object):
iter_ = buffer_.get_end_iter() iter_ = buffer_.get_end_iter()
mark = buffer_.create_mark(None, iter_, True) mark = buffer_.create_mark(None, iter_, True)
# start downloading image # start downloading image
gajim.thread_interface(helpers.download_image, [ app.thread_interface(helpers.download_image, [
self.textview.account, {'src': special_text}], self._update_img, self.textview.account, {'src': special_text}], self._update_img,
[mark]) [mark])

View File

@@ -4,7 +4,7 @@ import gtk
import json import json
import urllib import urllib
import urllib2 import urllib2
from common import gajim from common import app
from common import ged from common import ged
from plugins import GajimPlugin from plugins import GajimPlugin
from plugins.helpers import log_calls from plugins.helpers import log_calls
@@ -49,7 +49,7 @@ class UrlShortenerPlugin(GajimPlugin):
if hasattr(event, 'shortened'): if hasattr(event, 'shortened'):
return return
iterator = gajim.interface.basic_pattern_re.finditer(event.message) iterator = app.interface.basic_pattern_re.finditer(event.message)
for match in iterator: for match in iterator:
start, end = match.span() start, end = match.span()
link = event.message[start:end] link = event.message[start:end]
@@ -125,7 +125,7 @@ class Base(object):
if is_xhtml_link: if is_xhtml_link:
break break
# Check if we accept this as an uri # Check if we accept this as an uri
schemes = gajim.config.get('uri_schemes').split() schemes = app.config.get('uri_schemes').split()
for scheme in schemes: for scheme in schemes:
if special_text.startswith(scheme): if special_text.startswith(scheme):
text_is_valid_uri = True text_is_valid_uri = True
@@ -135,7 +135,7 @@ class Base(object):
return return
end_iter = buffer_.get_end_iter() end_iter = buffer_.get_end_iter()
mark = buffer_.create_mark(None, end_iter, True) mark = buffer_.create_mark(None, end_iter, True)
gajim.thread_interface(self.insert_hyperlink, [mark, special_text, app.thread_interface(self.insert_hyperlink, [mark, special_text,
ttt]) ttt])
self.textview.plugin_modified = True self.textview.plugin_modified = True

View File

@@ -1,9 +1,9 @@
[info] [info]
name: Wicd support name: Wicd support
short_name: wicd_support short_name: wicd_support
version: 0.1.2 version: 0.1.3
description: Support for autodetection of network status for Wicd Network Manager. description: Support for autodetection of network status for Wicd Network Manager.
Requires wicd and python-dbus. Requires wicd and python-dbus.
authors = Denis Fomin <fominde@gmail.com> authors = Denis Fomin <fominde@gmail.com>
homepage = http://trac-plugins.gajim.org/wiki/WicdSupportPlugin homepage = http://trac-plugins.gajim.org/wiki/WicdSupportPlugin
min_gajim_version: 0.16.10 min_gajim_version: 0.16.11

View File

@@ -2,10 +2,10 @@
import os import os
from common import gajim from gajim.common import app
from plugins import GajimPlugin from gajim.plugins import GajimPlugin
from plugins.helpers import log_calls from gajim.plugins.helpers import log_calls
from common import dbus_support from gajim.common import dbus_support
class WicdPlugin(GajimPlugin): class WicdPlugin(GajimPlugin):
@@ -31,7 +31,7 @@ class WicdPlugin(GajimPlugin):
def activate(self): def activate(self):
try: try:
import dbus import dbus
from common.dbus_support import system_bus from app.common.dbus_support import system_bus
self.bus = system_bus.bus() self.bus = system_bus.bus()
@@ -59,12 +59,12 @@ class WicdPlugin(GajimPlugin):
#WIRED = 3 #WIRED = 3
#SUSPENDED = 4 #SUSPENDED = 4
if state == 2 or state == 3: if state == 2 or state == 3:
for connection in gajim.connections.values(): for connection in app.connections.values():
if gajim.config.get_per('accounts', connection.name, if app.config.get_per('accounts', connection.name,
'listen_to_network_manager') and connection.time_to_reconnect: 'listen_to_network_manager') and connection.time_to_reconnect:
connection._reconnect() connection._reconnect()
else: else:
for connection in gajim.connections.values(): for connection in app.connections.values():
if gajim.config.get_per('accounts', connection.name, if app.config.get_per('accounts', connection.name,
'listen_to_network_manager') and connection.connected > 1: 'listen_to_network_manager') and connection.connected > 1:
connection._disconnectedReconnCB() connection._disconnectedReconnCB()

View File

@@ -1,8 +1,8 @@
[info] [info]
name: Wrong Layout name: Wrong Layout
short_name: Wrong Layout short_name: Wrong Layout
version: 0.1.3 version: 0.1.4
description: Press alt+r to convert chars typed in wrong layout Rus&lt;&gt;Eng description: Press alt+r to convert chars typed in wrong layout Rus&lt;&gt;Eng
authors: Denis Fomin <fominde@gmail.com> authors: Denis Fomin <fominde@gmail.com>
homepage: https://dev.gajim.org/gajim/gajim-plugins/wikis/WrongLayoutPlugin homepage: https://dev.gajim.org/gajim/gajim-plugins/wikis/WrongLayoutPlugin
min_gajim_version: 0.16.10 min_gajim_version: 0.16.11

View File

@@ -2,11 +2,11 @@
from gi.repository import Gtk from gi.repository import Gtk
from gi.repository import Gdk from gi.repository import Gdk
from common import helpers from gajim.common import helpers
from common import gajim from gajim.common import app
from plugins import GajimPlugin from gajim.plugins import GajimPlugin
from plugins.helpers import log_calls from gajim.plugins.helpers import log_calls
class WrongLayoutPlugin(GajimPlugin): class WrongLayoutPlugin(GajimPlugin):
@@ -118,7 +118,7 @@ class Base(object):
else: else:
start = message_buffer.get_start_iter() start = message_buffer.get_start_iter()
end = message_buffer.get_end_iter() end = message_buffer.get_end_iter()
stext = gajim.config.get('gc_refer_to_nick_char') stext = app.config.get('gc_refer_to_nick_char')
res = start.forward_search(stext, Gtk.TextSearchFlags.TEXT_ONLY, None) res = start.forward_search(stext, Gtk.TextSearchFlags.TEXT_ONLY, None)
if res: if res:
first, start = res first, start = res