#NEWLINE# def handle_user_event( message , socket ) : #NEWLINE# #INDENT# '\n    Get message about user event `message` to be sent to `socket`.\n\n    Inspects the embedded user event and decides whether or not the passed\n    socket should receive notification of the event.\n\n    Returns None if the socket should not receive any message about this user\n    event, otherwise a dict containing information about the event.\n    ' #NEWLINE# if ( socket . request . authenticated_userid != message [ 'userid' ] ) : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# return { #NEWLINE# #INDENT# 'type' : 'session-change' , #NEWLINE# 'action' : message [ 'type' ] , #NEWLINE# 'model' : message [ 'session_model' ] , #NEWLINE# #UNINDENT# }