def __onIQReceived(self, iqID, iqType, pyGlooxTag): if self._lastRequestID != iqID: return if iqType == IQ_TYPE.ERROR: error = createServerActionIQError(CLIENT_ACTION_ID.SEARCH_USER_ROOM, pyGlooxTag) if error: reason = error.getMessage() else: reason = '' LOG_WARNING('Search error is not resolved on the client', pyGlooxTag.getXml()) self._onSearchFailed(reason) else: result = ChannelsListHandler().handleTag(pyGlooxTag) self._onSearchTokenComplete(iqID, list(result))
def __onIQReceived(self, iqID, iqType, pyGlooxTag): if self._lastRequestID != iqID: return if iqType == IQ_TYPE.ERROR: error = createServerActionIQError(CLIENT_ACTION_ID.SEARCH_USER_ROOM, pyGlooxTag) if error: reason = error.getMessage() else: reason = '' LOG_WARNING('Search error is not resolved on the client', pyGlooxTag.getXml()) self._onSearchFailed(reason) else: result = ChannelsListHandler().handleTag(pyGlooxTag) self._onSearchTokenComplete(iqID, list(result)[:self.getSearchResultLimit()])
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
def _getError(self, pyGlooxTag): return errors.createServerActionIQError(CLIENT_ACTION_ID.REMOVE_NOTE, pyGlooxTag)
def _getError(self, pyGlooxTag): return errors.createServerActionIQError(CLIENT_ACTION_ID.APPROVE_FRIENDSHIP, pyGlooxTag)
def _getError(self, pyGlooxTag): return errors.createServerActionIQError(CLIENT_ACTION_ID.ADD_IGNORED, pyGlooxTag)
def _getError(self, pyGlooxTag): return errors.createServerActionIQError(CLIENT_ACTION_ID.CHANGE_GROUP, pyGlooxTag)
def _getError(self, pyGlooxTag): return errors.createServerActionIQError( CLIENT_ACTION_ID.APPROVE_FRIENDSHIP, pyGlooxTag)
def _setIQError(self, tag): error = errors.createServerActionIQError(self._getActionID(), tag) if error is not None: g_messengerEvents.onErrorReceived(error) self._remove() return