Beispiel #1
0
def route_get_cascaders_info():
    uun = current_user.get_username()

    return jsonify({
        "enabled": flask_redis.sismember("cascaders.users", uun),
        "tagline": flask_redis.hget("cascaders.taglines", uun),
    })
Beispiel #2
0
    def get_friend(self, friend_hash, ignore_dnd=False):
        from map import flask_redis

        if check_uun_hash(self.get_username(), friend_hash):
            if self.get_dnd() and not ignore_dnd:
                return ""
            return self.get_username()

        all_friends = flask_redis.smembers(self.get_username() + '-friends')

        for friend in all_friends:
            if check_uun_hash(friend, friend_hash):
                from map import flask_redis
                is_dnd = flask_redis.sismember("dnd-users", friend)
                if is_dnd and not ignore_dnd:
                    return ""
                else:
                    return friend
        return ""
Beispiel #3
0
 def get_dnd(self):
     from map import flask_redis
     return flask_redis.sismember("dnd-users", self.get_username())