Adapt Zeroconf to nbxmpp changes

Fixes #9503
This commit is contained in:
Philipp Hörist 2018-12-23 22:33:10 +01:00
parent b548b90a6c
commit c63e32634a
2 changed files with 10 additions and 1 deletions

View File

@ -26,7 +26,10 @@ from gajim.common.types import ConnectionT
log = logging.getLogger('gajim.c.m')
ZEROCONF_MODULES = ['adhoc_commands', 'receipts', 'discovery']
ZEROCONF_MODULES = ['adhoc_commands',
'receipts',
'discovery',
'chatstates']
_imported_modules = [] # type: List[tuple]
_modules = {} # type: Dict[str, Dict[str, Any]]

View File

@ -15,6 +15,8 @@
# You should have received a copy of the GNU General Public License
# along with Gajim. If not, see <http://www.gnu.org/licenses/>.
from unittest.mock import Mock
from gajim.common import app
import nbxmpp
from nbxmpp.idlequeue import IdleObject
@ -141,6 +143,7 @@ class P2PClient(IdleObject):
self.Namespace = 'jabber:client'
self.protocol_type = 'XMPP'
self.defaultNamespace = self.Namespace
self.Smacks = Mock()
self._component = 0
self._registered_name = None
self._caller = conn_holder.caller
@ -190,6 +193,9 @@ class P2PClient(IdleObject):
self.on_responses = {}
def get_bound_jid(self):
return self._caller.get_own_jid()
def add_stanza(self, stanza, is_message=False):
if self.Connection:
if self.Connection.state == -1: