From 685ca532c5f30b41da003878cbfca8183b4965b7 Mon Sep 17 00:00:00 2001 From: kaliko Date: Thu, 30 Apr 2020 20:14:30 +0200 Subject: [PATCH] Switched to slixmpp --- sid/sid.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sid/sid.py b/sid/sid.py index 604a63a..0df5478 100644 --- a/sid/sid.py +++ b/sid/sid.py @@ -2,7 +2,7 @@ # Copyright (C) 2007-2012 Thomas Perl # Copyright (C) 2010, 2011 Anaël Verrier -# Copyright (C) 2014-2015 kaliko +# Copyright (C) 2014, 2015, 2020 kaliko # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -21,7 +21,7 @@ import inspect import logging import traceback -import sleekxmpp +import slixmpp def botcmd(*args, **kwargs): @@ -41,7 +41,7 @@ def botcmd(*args, **kwargs): return lambda func: decorate(func, **kwargs) -class MUCBot(sleekxmpp.ClientXMPP): +class MUCBot(slixmpp.ClientXMPP): prefix = '!' @@ -58,6 +58,7 @@ class MUCBot(sleekxmpp.ClientXMPP): self.__seen = dict() self.register_plugin('xep_0030') # Service Discovery self.register_plugin('xep_0045') # Multi-User Chat + self.register_plugin('xep_0071') # xhtml-im self.register_plugin('xep_0199') # self Ping # The session_start event will be triggered when @@ -83,7 +84,8 @@ class MUCBot(sleekxmpp.ClientXMPP): log_fd = open(log_file, 'w') if log_file else None chandler = logging.StreamHandler(log_fd) formatter = logging.Formatter( - '%(asctime)s - %(name)s - %(levelname)s - %(message)s') + '%(asctime)s - %(name)s - %(levelname)s - %(message)s' + ) chandler.setFormatter(formatter) self.log.addHandler(chandler) self.log.setLevel(log_level) @@ -138,7 +140,7 @@ class MUCBot(sleekxmpp.ClientXMPP): """ self.get_roster() self.send_presence() - self.plugin['xep_0045'].joinMUC(self.room, + self.plugin['xep_0045'].join_muc(self.room, self.nick, # If a room password is needed, use: # password=the_room_password, -- 2.39.2