Example #1
0
    def deleteChatroom(cls, obj, params):
        """ Deletes the chat room in the database according to all kind of indexing types"""

        chatroom = params['room']

        confId = obj._conferenceID
        #if we have the same room used in two or more different conferences, we just delete it from the
        #conferences list in the chat room and from the IndexByConf index
        chatroom.getConferences().pop(confId)
        confIndex = IndexByConf()
        confIndex.unindex(confId, chatroom)

        if len(chatroom.getConferences()) is 0:
            #there are no more references to the chat room, we completely delete it
            crNameIndex = IndexByCRName()
            crNameIndex.unindex(chatroom)

            idIndex = IndexByID()
            idIndex.unindex(chatroom)

            userIndex = IndexByUser()
            userIndex.unindex(chatroom.getOwner().getId(), chatroom)
Example #2
0
    def deleteChatroom(cls, obj, params):
        """ Deletes the chat room in the database according to all kind of indexing types"""

        chatroom = params['room']

        confId = obj._conferenceID
        #if we have the same room used in two or more different conferences, we just delete it from the
        #conferences list in the chat room and from the IndexByConf index
        chatroom.getConferences().pop(confId)
        confIndex = IndexByConf()
        confIndex.unindex(confId, chatroom)

        if len(chatroom.getConferences()) is 0:
            #there are no more references to the chat room, we completely delete it
            crNameIndex = IndexByCRName()
            crNameIndex.unindex(chatroom)

            idIndex = IndexByID()
            idIndex.unindex(chatroom)

            userIndex = IndexByUser()
            userIndex.unindex(chatroom.getOwner().getId(), chatroom)