#NEWLINE# @ log_function #NEWLINE# def _persist_event_txn( self , txn , event , context , is_new_state = True , current_state = None ) : #NEWLINE# #INDENT# if current_state : #NEWLINE# #INDENT# txn . call_after ( self . _get_current_state_for_key . invalidate_all ) #NEWLINE# txn . call_after ( self . get_rooms_for_user . invalidate_all ) #NEWLINE# txn . call_after ( self . get_users_in_room . invalidate , ( event . room_id , ) ) #NEWLINE# txn . call_after ( self . get_joined_hosts_for_room . invalidate , ( event . room_id , ) ) #NEWLINE# txn . call_after ( self . get_room_name_and_aliases , event . room_id ) #NEWLINE# self . _simple_delete_txn ( txn , table = 'current_state_events' , keyvalues = { #NEWLINE# #INDENT# 'room_id' : event . room_id , #NEWLINE# #UNINDENT# } ) #NEWLINE# for s in current_state : #NEWLINE# #INDENT# self . _simple_insert_txn ( txn , 'current_state_events' , { #NEWLINE# #INDENT# 'event_id' : s . event_id , #NEWLINE# 'room_id' : s . room_id , #NEWLINE# 'type' : s . type , #NEWLINE# 'state_key' : s . state_key , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# #UNINDENT# return self . _persist_events_txn ( txn , [ ( event , context ) ] , backfilled = False , is_new_state = self )