e4fa41214d03d5c0163fe3cc4d3479d3b5007ccb,dino/hooks/disconnect.py,OnDisconnectHooks,leave_all_public_rooms_and_emit_leave_events,#Any#,38

Before Change



    @staticmethod
    def leave_all_public_rooms_and_emit_leave_events(arg: tuple):
        user_id = str(environ.env.session.get(SessionKeys.user_id.value))
        user_name = environ.env.session.get(SessionKeys.user_name.value)
        rooms = environ.env.db.rooms_for_user(user_id)

        for room_id, room_name in rooms.items():

After Change


    @staticmethod
    def leave_all_public_rooms_and_emit_leave_events(arg: tuple):
        data, activity = arg
        try:
            user_id = activity.actor.id
            user_name = environ.env.session.get(SessionKeys.user_name.value)
            rooms = environ.env.db.rooms_for_user(user_id)

            for room_id, room_name in rooms.items():
                utils.remove_user_from_room(user_id, user_name, room_id)
                environ.env.emit("gn_user_left", utils.activity_for_leave(user_id, user_name, room_id, room_name), room=room_id)

            environ.env.db.remove_current_rooms_for_user(user_id)
        except Exception as e:
            logger.error("could not leave all public rooms: %s" % str(e))
            logger.debug("request for failed leave_all_public_rooms_and_emit_leave_events(): %s" % str(data))
            logger.exception(traceback.format_exc())

    @staticmethod
    def set_user_offline(arg: tuple):
        data, activity = arg
        try:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: thenetcircle/dino
Commit Name: e4fa41214d03d5c0163fe3cc4d3479d3b5007ccb
Time: 2016-12-27
Author: oscar.eriks@gmail.com
File Name: dino/hooks/disconnect.py
Class Name: OnDisconnectHooks
Method Name: leave_all_public_rooms_and_emit_leave_events


Project Name: sahana/eden
Commit Name: d0836dd9d191d5a0f0b944e8a71cedaeb2c05724
Time: 2020-07-15
Author: fran@aidiq.com
File Name: modules/s3/s3task.py
Class Name: S3Task
Method Name: run_async


Project Name: thenetcircle/dino
Commit Name: e4fa41214d03d5c0163fe3cc4d3479d3b5007ccb
Time: 2016-12-27
Author: oscar.eriks@gmail.com
File Name: dino/hooks/disconnect.py
Class Name: OnDisconnectHooks
Method Name: emit_disconnect_event