Example #1
0
 def addReactions(self, form):
     print(form)
     uid = form['uid']
     mid = form['mid']
     gid = form['gid']
     type = form['type']
     MessagesDAO().addReactions(uid, mid, type)
     result = buildDict.build_reaction_dict_by_attr(self, uid, mid, type)
     return GroupChatsHandler().getMessagesByGroupChatId(gid)
def getUsersInAGroupChat(gid):
    if request.method == 'GET':
        return GroupChatsHandler().getUsersInAGroupChat(gid)
    else:
        return GroupChatsHandler().addUsersToGroupChat(gid, request.json)
def getAllGroupChats():
    return GroupChatsHandler().getAllGroupChats()
def MessagesByHashTagInGroup(gid, hstring):
    return GroupChatsHandler().getMessagesByHashTagInGroup(gid, hstring)
def getMessagesByGroupChatId(gid):
    if request.method == 'GET':
        return GroupChatsHandler().getMessagesByGroupChatId(gid)
    else:
        return GroupChatsHandler().postMessage(gid, request.json)
def replyToMessageGroupChatId(gid):
    if request.method == 'POST':
        return GroupChatsHandler().replyToMessage(gid, request.json)
def availableGroupChats(uid):
    if request.method == 'GET':
        return GroupChatsHandler().availableGroupChats(uid)
    else:
        print("main")
        return GroupChatsHandler().createGroupChat(uid, request.json)
def getOwnerOfGroupChat(gid):
    return GroupChatsHandler().getOwnerOfGroupChat(gid)