From 36f4e9b324bcafac113c2178e8e5d05d06f085d5 Mon Sep 17 00:00:00 2001 From: Aleksej Date: Tue, 14 Jun 2022 15:00:51 +0200 Subject: [PATCH] fix false positives in testbot --- test/testbot | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/test/testbot b/test/testbot index 35b345a..e9b1068 100755 --- a/test/testbot +++ b/test/testbot @@ -91,17 +91,24 @@ class MUCBot(slixmpp.ClientXMPP): def muc_message(self, msg): rtime=time.time() - rcpt=msg['from'].bare + if msg['mucnick'] == self.nick: + return body="%(body)s" % msg + unknownmsg = True if self.room1 in str(msg['from']): for i in results2: - if i[0] == body: + if 'xmppbot: ' + i[0] == body: i[2] = rtime + unknownmsg = False if self.room2 in str(msg['from']): for i in results1: - if i[0] == body: + if 'xmppbot: ' + i[0] == body: i[2] = rtime + unknownmsg = False + + if unknownmsg: + print("Unknown message recieved: " + body) if allmsgsrecv() is True: printandexit()