Commit 0686a846 authored by Michal Schmidt's avatar Michal Schmidt

Assume nbxmpp availability in all plugins

Trying to import non-existent common.xmpp would trigger an exception were it
not for a a side-effect of demandimport that Gajim uses. It's not nice to rely
on it in gotr and juick.

juick does not use nbxmpp for anything. Let's just drop the import.

whiteboard does a Gajim version check that no other plugin does.

nbxmpp has been required since Gajim 0.16. In all plugins let's just assume
it's available. Some plugins already do that.
parent bf0ec988
......@@ -68,7 +68,6 @@ import sys
from pprint import pformat
from distutils.version import StrictVersion
import common.xmpp
from common import gajim
from common import ged
from common.connection_handlers_events import MessageOutgoingEvent
......@@ -93,11 +92,7 @@ try:
except ImportError:
HAS_CRYPTO = False
nb_xmpp = False
import common.xmpp
if not dir(common.xmpp):
import nbxmpp
nb_xmpp = True
import nbxmpp
HAS_POTR = True
try:
......@@ -133,10 +128,7 @@ try:
msg = unicode(msg)
account = self.user.accountname
if not nb_xmpp:
stanza = common.xmpp.Message(to=self.peer, body=msg, typ='chat')
else:
stanza = nbxmpp.Message(to=self.peer, body=msg, typ='chat')
stanza = nbxmpp.Message(to=self.peer, body=msg, typ='chat')
if appdata is not None:
session = appdata.get('session', None)
if session is not None:
......@@ -741,4 +733,4 @@ def escape(s):
def add_message_processing_hints(stanza):
stanza.addChild(name='private', namespace=nbxmpp.NS_CARBONS)
stanza.addChild(name='no-permanent-store', namespace=nbxmpp.NS_MSG_HINTS)
stanza.addChild(name='no-copy', namespace=nbxmpp.NS_MSG_HINTS)
\ No newline at end of file
stanza.addChild(name='no-copy', namespace=nbxmpp.NS_MSG_HINTS)
......@@ -21,13 +21,6 @@ from plugins.gui import GajimPluginConfigDialog
from conversation_textview import TextViewImage
import gtkgui_helpers
nb_xmpp = False
import common.xmpp
if not dir(common.xmpp):
import nbxmpp
nb_xmpp = True
class JuickPlugin(GajimPlugin):
@log_calls('JuickPlugin')
def init(self):
......
......@@ -34,11 +34,7 @@ from plugins import GajimPlugin
from plugins.plugin import GajimPluginException
from plugins.helpers import log_calls, log
from common import gajim
ver = list(gajim.config.get('version').split('.'))
if ver < [0, 15, 3, 0]:
from common.xmpp import Message
else:
from nbxmpp import Message
from nbxmpp import Message
import gtk
import chat_control
from common import ged
......
......@@ -25,13 +25,7 @@ try:
HAS_GOOCANVAS = True
except:
HAS_GOOCANVAS = False
from common import gajim
ver = list(gajim.config.get('version').split('.'))
if ver < [0, 15, 3, 0]:
from common.xmpp import Node
else:
from nbxmpp import Node
from nbxmpp import Node
from dialogs import FileChooserDialog
'''
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment