def sendMessage(self, jid, body, filters): channel = self.channelsStorage.getChannel(entities.XMPPChatChannelEntity(jid)) if channel: if self.playerCtx.isChatBan(): error = createChatBanError(self.playerCtx.getBanInfo()) if error: g_messengerEvents.onErrorReceived(error) return dbID = getPlayerDatabaseID() name = getPlayerName() g_messengerEvents.channels.onMessageReceived(XMPPMessageData(dbID, name, filters.chainIn(dbID, body), time.time()), channel) self.client().sendMessage(ChatMessageHolder(jid, msgBody=body))
def sendMessage(self, jid, body, filters): _, exists = self._searchChannel(jid) if exists is None: return elif self.playerCtx.isBanned(components=exists.getBanComponent()): error = createChatBanError(self.playerCtx.getBanInfo()) if error: g_messengerEvents.onErrorReceived(error) return else: self._repeatMessage(exists, body, filters) self.client().sendMessage(chat_ext.ChatMessageHolder(exists.getMessageType(), jid, msgBody=body)) return
def sendMessage(self, jid, body, filters): channel = self.channelsStorage.getChannel( entities.XMPPChatChannelEntity(jid)) if channel: if self.playerCtx.isBanned(components=XMPP_BAN_COMPONENT.PRIVATE): error = createChatBanError(self.playerCtx.getBanInfo()) if error: g_messengerEvents.onErrorReceived(error) return dbID = getPlayerDatabaseID() name = getPlayerName() g_messengerEvents.channels.onMessageReceived( ChatMessage(dbID, name, filters.chainIn(dbID, body), time.time()), channel) self.client().sendMessage(ChatMessageHolder(jid, msgBody=body))
def sendMessage(self, jid, body, filters): _, exists = self._searchChannel(jid) if exists is None: return elif self.playerCtx.isBanned(components=exists.getBanComponent()): error = createChatBanError(self.playerCtx.getBanInfo()) if error: g_messengerEvents.onErrorReceived(error) return else: self._repeatMessage(exists, body, filters) self.client().sendMessage( chat_ext.ChatMessageHolder(exists.getMessageType(), jid, msgBody=body)) return