#NEWLINE# @ defer . inlineCallbacks #NEWLINE# def on_PUT( self , request , user_id , room_id , account_data_type ) : #NEWLINE# #INDENT# requester = ( yield self . auth . get_user_by_req ( request ) ) #NEWLINE# if ( user_id != requester . user . to_string ( ) ) : #NEWLINE# #INDENT# raise AuthError ( 403 , 'Cannot add account data for other users.' ) #NEWLINE# #UNINDENT# body = parse_json_object_from_request ( request ) #NEWLINE# max_id = ( yield self . store . add_account_data_to_room ( user_id , room_id , account_data_type , body ) ) #NEWLINE# self . notifier . on_new_event ( 'account_data_key' , max_id , users = [ user_id ] ) #NEWLINE# defer . returnValue ( ( 200 , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) )