本文整理汇总了Python中messenger.proto.events.g_messengerEvents.onErrorReceived函数的典型用法代码示例。如果您正苦于以下问题:Python onErrorReceived函数的具体用法?Python onErrorReceived怎么用?Python onErrorReceived使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了onErrorReceived函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _onResponseFailure
def _onResponseFailure(self, ids, args):
if super(AdminChatCommandHandler, self)._onResponseFailure(ids, args):
error = errors.createAdminCommandError(args)
if error:
g_messengerEvents.onErrorReceived(error)
else:
LOG_WARNING('Error is not resolved on the client', ids, args)
示例2: error
def error(self, pyGlooxTag):
error = self._getError(pyGlooxTag)
if error:
g_messengerEvents.onErrorReceived(error)
else:
g_logOutput.error(_LOG_AREA.PY_WRAPPER, 'Error is not resolved on the client', self.__class__.__name__, pyGlooxTag.getXml())
self._result = TASK_RESULT.CLEAR
示例3: _onResponseFailure
def _onResponseFailure(self, ids, args):
if super(VOIPChatProvider, self)._onResponseFailure(ids, args):
error = errors.createVOIPError(args)
if error:
g_messengerEvents.onErrorReceived(error)
else:
LOG_WARNING('Error is not resolved on the client', ids, args)
示例4: createPrivateChannel
def createPrivateChannel(self, dbID, name):
if GUI_SETTINGS.useXmppToCreatePrivate:
result, error = self.__xmppProto.messages.startChatSession(dbID, name)
if not result:
g_messengerEvents.onErrorReceived(error)
else:
self.__bwProto.users.createPrivateChannel(dbID, name)
return True
示例5: _setIQError
def _setIQError(self, tag):
if self._step == ENTRY_STEP.SET_DATA_FORM:
self._sendPresence(chat_ext.MUCLeaveQuery(self._getUserJID()))
error = errors.createServerUserRoomCreationIQError(tag, self._room.getName())
if error is not None:
g_messengerEvents.onErrorReceived(error)
self._remove()
return
示例6: sendChatMessage
def sendChatMessage(self, jid, body):
if self.__cooldown.isInProcess(CLIENT_ACTION_ID.SEND_MESSAGE):
g_messengerEvents.onErrorReceived(ChatCoolDownError(CLIENT_ACTION_ID.SEND_MESSAGE, self.__limits.getBroadcastCoolDown()))
return
body = self.__msgFilters.chainOut(body, self.__limits)
if not body:
return
self.__chatSessions.sendMessage(ContactBareJID(jid), body, self.__msgFilters)
self.__cooldown.process(CLIENT_ACTION_ID.SEND_MESSAGE)
示例7: sendPassword
def sendPassword(self, value):
validator = self.proto.messages.getUserRoomValidator()
password, error = validator.validateUserRoomPwd(value)
if error is not None:
g_messengerEvents.onErrorReceived(error)
else:
self.proto.messages.joinToUserRoom(self._channel.getID(), password=password)
self.destroy()
return
示例8: parseLine
def parseLine(self, text, clientID = 0):
cmd, result = None, admin_chat_cmd.parseCommandLine(text)
if not result:
return (False, None)
if result.hasError():
g_messengerEvents.onErrorReceived(result.getError())
else:
decorator = admin_chat_cmd.makeDecorator(result, clientID)
if self.send(decorator):
cmd = decorator
return (True, cmd)
示例9: _onResponseFailure
def _onResponseFailure(self, ids, args):
actionID = super(VOIPChatProvider, self)._onResponseFailure(ids, args)
if actionID is None:
return
error, logOnly = errors.createVOIPError(args, actionID)
if error:
if logOnly:
LOG_NOTE(error)
else:
g_messengerEvents.onErrorReceived(error)
else:
LOG_WARNING('Error is not resolved on the client to display in GUI', actionID, ids, args)
示例10: sendMessage
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))
示例11: _setPresenceError
def _setPresenceError(self, tag):
error = errors.createServerActionPresenceError(self._getActionID(), tag)
if error is not None:
if error.getErrorType() == ERROR_TYPE.AUTH and error.getCondition() == 'not-authorized' and self._step != ENTRY_STEP.PASSWORD_REQUIRED:
self._step = ENTRY_STEP.PASSWORD_REQUIRED
g_messengerEvents.channels.onConnectingToSecureChannel(self._room)
else:
g_messengerEvents.onErrorReceived(error)
self._remove()
else:
self._remove()
return
示例12: sendMessage
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
示例13: doAction
def doAction(self, actionID, args = None, response = False, skipCoolDown = False):
success, reqID = False, 0
if self.__coolDown.isInProcess(actionID):
if not skipCoolDown:
g_messengerEvents.onErrorReceived(createCoolDownError(actionID))
else:
if response:
reqID = self.__idGen.next()
if self.__isEnabled:
success = self.__sendAction(actionID, reqID, args)
else:
success = self.__addActionToQueue(actionID, reqID, args)
return (success, reqID)
示例14: _join
def _join(self, info):
if info is not None:
statuses = info.statuses
else:
statuses = ()
if MUC_STATUS.SELF_PRESENCE in statuses and MUC_STATUS.CREATE_ROOM in statuses:
self._step = ENTRY_STEP.SET_DATA_FORM
self._sendIQ(chat_ext.UserRoomConfigurationFormSet(self._room.getID(), self._room.getName(), self._room.getPassword()))
else:
g_messengerEvents.onErrorReceived(ClientActionError(CLIENT_ACTION_ID.CREATE_USER_ROOM, CLIENT_ERROR_ID.GENERIC))
self._result = ACTION_RESULT.DO_NOTHING
self._sendPresence(chat_ext.MUCLeaveQuery(self._getUserJID()))
return
示例15: handleIQ
def handleIQ(self, iqID, iqType, tag):
if iqID == self.__iqID:
if iqType == IQ_TYPE.RESULT:
self.__state = _HISTORY_RQ_STATE.RESULT
elif iqType == IQ_TYPE.ERROR:
self.__state = _HISTORY_RQ_STATE.UNAVAILABLE
error = errors.createServerActionIQError(CLIENT_ACTION_ID.RQ_HISTORY, tag)
if error:
g_messengerEvents.onErrorReceived(error)
while self.__pool:
self.__setChannelHistory(self.__pool.pop(0))
result = True
else:
result = False
return result