Example #1
0
def createChatBanError(banInfo):
    error = None
    item = banInfo.getFirstActiveItem()
    if item:
        if item.expiresAt:
            expiresAt = time_utils.makeLocalServerTime(item.expiresAt)
        else:
            expiresAt = 0
        error = shared_errors.ChatBanError(expiresAt, item.reason)
    return error
Example #2
0
def createChatBanError(banInfo):
    error = None
    item = banInfo.getFirstActiveItem()
    if item:
        error = shared_errors.ChatBanError(item.expiresAt, item.reason)
    return error