示例#1
0
def createServerActionMessageError(actionID, pyGlooxTag):
    errorType, condition = ProxyHandler(
        StanzaErrorExtension()).handleTag(pyGlooxTag)
    return ServerActionError(
        actionID, errorType, condition
    ) if condition != DEF_STANZA_ERROR_CONDITION else ClientActionError(
        actionID, CLIENT_ERROR_ID.GENERIC)
示例#2
0
def createServerUserRoomCreationIQError(pyGlooxTag, roomName):
    errorID = IQHandler(WgErrorExtension()).handleTag(pyGlooxTag)
    if errorID != xmpp_constants.MUC_CREATION_ERROR.UNDEFINED:
        error = ServerUserRoomCreationError(errorID, roomName)
    else:
        error = ServerActionError(CLIENT_ACTION_ID.CREATE_USER_ROOM, *IQHandler(StanzaErrorExtension()).handleTag(pyGlooxTag))
    return error
示例#3
0
def createServerActionError(actionID, pyGlooxTag):
    return ServerActionError(
        actionID,
        IQHandler(StanzaErrorExtension()).handleTag(pyGlooxTag)[1])
示例#4
0
def createServerError(pyGlooxTag):
    return StanzaConditionError(
        IQHandler(StanzaErrorExtension()).handleTag(pyGlooxTag)[1])
示例#5
0
def createServerActionPresenceError(actionID, pyGlooxTag):
    return ServerActionError(
        actionID,
        *ProxyHandler(StanzaErrorExtension()).handleTag(pyGlooxTag))
示例#6
0
def createServerPresenceError(pyGlooxTag):
    return StanzaConditionError(
        *ProxyHandler(StanzaErrorExtension()).handleTag(pyGlooxTag))