e4fa41214d03d5c0163fe3cc4d3479d3b5007ccb,dino/hooks/disconnect.py,OnDisconnectHooks,leave_private_room,#Any#,27
Before Change
@staticmethod
def leave_private_room(arg: tuple):
// todo: only broadcast "offline" status if current status is "online" (i.e. don"t broadcast if e.g. "invisible")
user_id = str(environ.env.session.get(SessionKeys.user_id.value))
user_name = environ.env.session.get(SessionKeys.user_name.value)
logger.debug("a user disconnected, id "%s" name "%s"" % (user_id, user_name))
if user_id is None or len(user_id.strip()) == 0:
After Change
@staticmethod
def leave_private_room(arg: tuple):
data, activity = arg
try:
// todo: only broadcast "offline" status if current status is "online" (i.e. don"t broadcast if e.g. "invisible")
user_id = activity.actor.id
user_name = environ.env.session.get(SessionKeys.user_name.value)
logger.debug("a user disconnected, id "%s" name "%s"" % (user_id, user_name))
if user_id is None or len(user_id.strip()) == 0:
return
environ.env.leave_room(user_id)
except Exception as e:
logger.error("could not leave private room: %s" % str(e))
logger.debug("request for failed leave_private_room(): %s" % str(data))
logger.exception(traceback.format_exc())
@staticmethod
def leave_all_public_rooms_and_emit_leave_events(arg: tuple):
data, activity = arg
try:
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 17
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_private_room
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: 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