Send xhtml on group message to XMPP MUC
This commit is contained in:
parent
5cd4442ddc
commit
e32365a065
10
session.py
10
session.py
|
@ -279,7 +279,7 @@ class Session(YowsupApp):
|
|||
if participant is not None: # Group message
|
||||
partname = participant.split('@')[0]
|
||||
if notify is None:
|
||||
notify = "";
|
||||
notify = ""
|
||||
self.sendGroupMessageToXMPP(buddy, partname, messageContent,
|
||||
timestamp, notify)
|
||||
else:
|
||||
|
@ -479,9 +479,9 @@ class Session(YowsupApp):
|
|||
self.logger.info("Stopped typing: %s to %s", self.legacyName, buddy)
|
||||
self.sendTyping(buddy, False)
|
||||
|
||||
def sendMessageToWA(self, sender, message, ID):
|
||||
self.logger.info("Message sent from %s to %s: %s",
|
||||
self.legacyName, sender, message)
|
||||
def sendMessageToWA(self, sender, message, ID, xhtml=""):
|
||||
self.logger.info("Message sent from %s to %s: %s (xhtml=%s)",
|
||||
self.legacyName, sender, message, xhtml)
|
||||
|
||||
message = message.encode("utf-8")
|
||||
# FIXME: Fragile, should pass this in to onDlerror
|
||||
|
@ -519,7 +519,7 @@ class Session(YowsupApp):
|
|||
self.logger.debug("Group Message from %s to %s Groups: %s",
|
||||
group.nick , group , self.groups)
|
||||
self.backend.handleMessage(
|
||||
self.user, room, message.decode('utf-8'), group.nick
|
||||
self.user, room, message.decode('utf-8'), group.nick, xhtml=xhtml
|
||||
)
|
||||
except KeyError:
|
||||
self.logger.error('Group not found: %s', room)
|
||||
|
|
|
@ -61,9 +61,9 @@ class WhatsAppBackend(SpectrumBackend):
|
|||
# causes duplicate messages. Thus we should not send consecutive
|
||||
# messages with the same id
|
||||
if ID == '':
|
||||
self.sessions[user].sendMessageToWA(buddy, message, ID)
|
||||
self.sessions[user].sendMessageToWA(buddy, message, ID, xhtml)
|
||||
elif user not in self.lastMsgId or self.lastMsgId[user] != ID:
|
||||
self.sessions[user].sendMessageToWA(buddy, message, ID)
|
||||
self.sessions[user].sendMessageToWA(buddy, message, ID, xhtml)
|
||||
self.lastMsgId[user] = ID
|
||||
|
||||
def handleJoinRoomRequest(self, user, room, nickname, pasword):
|
||||
|
|
Loading…
Reference in a new issue