Files
@ daeb6dfc9a9f
Branch filter:
Location: libtransport.git/tests/libcommuni/muc_pm.py - annotation
daeb6dfc9a9f
2.0 KiB
text/x-python
Enable support for Qt5
Since Qt4 is EOL, we should also support libcommuni build with Qt5.
In order not to break Fedora docker builds, -DENABLE_QT4 is introduced.
When set to 'ON', support for Qt4 is being enabled,
otherwise support for Qt5 is enabled.
Signed-off-by: Conrad Kostecki <conrad@kostecki.com>
Since Qt4 is EOL, we should also support libcommuni build with Qt5.
In order not to break Fedora docker builds, -DENABLE_QT4 is introduced.
When set to 'ON', support for Qt4 is being enabled,
otherwise support for Qt5 is enabled.
Signed-off-by: Conrad Kostecki <conrad@kostecki.com>
efd14b776ccc efd14b776ccc efd14b776ccc efd14b776ccc efd14b776ccc efd14b776ccc efd14b776ccc efd14b776ccc efd14b776ccc efd14b776ccc a025aa108559 efd14b776ccc efd14b776ccc a025aa108559 efd14b776ccc efd14b776ccc efd14b776ccc efd14b776ccc efd14b776ccc efd14b776ccc efd14b776ccc efd14b776ccc ba5c6ce41e34 efd14b776ccc efd14b776ccc efd14b776ccc ba5c6ce41e34 ba5c6ce41e34 ba5c6ce41e34 ba5c6ce41e34 ba5c6ce41e34 ba5c6ce41e34 efd14b776ccc efd14b776ccc a025aa108559 efd14b776ccc efd14b776ccc efd14b776ccc efd14b776ccc efd14b776ccc efd14b776ccc efd14b776ccc efd14b776ccc efd14b776ccc efd14b776ccc efd14b776ccc ba5c6ce41e34 ba5c6ce41e34 efd14b776ccc efd14b776ccc efd14b776ccc ba5c6ce41e34 ba5c6ce41e34 ba5c6ce41e34 ba5c6ce41e34 efd14b776ccc efd14b776ccc efd14b776ccc efd14b776ccc efd14b776ccc efd14b776ccc efd14b776ccc | import optparse
import sys
import time
import subprocess
import os
import sleekxmpp
class Responder(sleekxmpp.ClientXMPP):
def __init__(self, jid, password, room, room_password, nick):
sleekxmpp.ClientXMPP.__init__(self, jid, password)
self.room = room
self.room_password = room_password
self.nick = nick
self.finished = False
self.add_event_handler("session_start", self.start)
self.add_event_handler("message", self.message)
self.tests = {}
def message(self, msg):
if msg['body'] == "abc" and msg['from'] == self.room + "/client":
self.send_message(mto=self.room + "/client",
mbody="echo %s" % msg['body'],
mtype='chat')
elif msg['body'] == "def" and msg['from'] == self.room + "/client":
self.send_message(mto=self.room + "/client",
mbody="echo %s" % msg['body'],
mtype='chat')
else:
self.finished = True
def start(self, event):
self.plugin['xep_0045'].joinMUC(self.room, self.nick, password=self.room_password, wait=True)
class Client(sleekxmpp.ClientXMPP):
def __init__(self, jid, password, room, nick):
sleekxmpp.ClientXMPP.__init__(self, jid, password)
self.room = room
self.nick = nick
self.add_event_handler("session_start", self.start)
self.add_event_handler("message", self.message)
self.finished = False
self.tests = {}
self.tests["echo1_received"] = ["libcommuni: Send and receive private messages - 1st msg", False]
self.tests["echo2_received"] = ["libcommuni: Send and receive private messages - 2nd msg", False]
def message(self, msg):
if msg['body'] == "echo abc" and msg['from'] == self.room + "/responder":
self.tests["echo1_received"][1] = True
self.send_message(mto=self.room + "/responder", mbody="def", mtype='chat')
elif msg['body'] == "echo def" and msg['from'] == self.room + "/responder":
self.tests["echo2_received"][1] = True
self.finished = True
def start(self, event):
self.getRoster()
self.sendPresence()
self.plugin['xep_0045'].joinMUC(self.room, self.nick, wait=True)
self.send_message(mto=self.room + "/responder", mbody="abc", mtype='chat')
|