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
示例#4
0
    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
示例#5
0
 def _getError(self, pyGlooxTag):
     return errors.createServerActionIQError(CLIENT_ACTION_ID.REMOVE_NOTE, pyGlooxTag)
示例#6
0
 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)
示例#8
0
 def _getError(self, pyGlooxTag):
     return errors.createServerActionIQError(CLIENT_ACTION_ID.REMOVE_NOTE, pyGlooxTag)
示例#9
0
 def _getError(self, pyGlooxTag):
     return errors.createServerActionIQError(CLIENT_ACTION_ID.CHANGE_GROUP, pyGlooxTag)
示例#10
0
 def _getError(self, pyGlooxTag):
     return errors.createServerActionIQError(
         CLIENT_ACTION_ID.APPROVE_FRIENDSHIP, pyGlooxTag)
示例#11
0
 def _setIQError(self, tag):
     error = errors.createServerActionIQError(self._getActionID(), tag)
     if error is not None:
         g_messengerEvents.onErrorReceived(error)
     self._remove()
     return
示例#12
0
 def _getError(self, pyGlooxTag):
     return errors.createServerActionIQError(CLIENT_ACTION_ID.ADD_IGNORED, pyGlooxTag)
示例#13
0
 def _setIQError(self, tag):
     error = errors.createServerActionIQError(self._getActionID(), tag)
     if error is not None:
         g_messengerEvents.onErrorReceived(error)
     self._remove()
     return
示例#14
0
 def _getError(self, pyGlooxTag):
     return errors.createServerActionIQError(CLIENT_ACTION_ID.CHANGE_GROUP,
                                             pyGlooxTag)