Module ImportFrom alias ImportFrom alias Import alias identifier Import alias Assign NameStore Call AttributeLoad NameLoad attr NameLoad ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam defaults body Expr Str FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Str Dict Str NameLoad ListLoad Str Str Assign NameStore DictComp SubscriptLoad NameLoad Index Str Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str comprehension NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Str Dict Str NameLoad ListLoad Str Str Str Assign NameStore Dict For NameStore NameLoad body Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str Dict Assign SubscriptStore NameLoad Index SubscriptLoad NameLoad Index Str Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str Return TupleLoad NameLoad NameLoad decorator_list Return Call AttributeLoad NameLoad attr Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Str Dict Str Str NameLoad NameLoad ListLoad Str Str Return DictComp SubscriptLoad NameLoad Index Str Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str comprehension NameStore NameLoad decorator_list Return Call AttributeLoad NameLoad attr Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Expr Str FunctionDef arguments args NameParam defaults body Assign NameStore Str Expr Call AttributeLoad NameLoad attr NameLoad TupleLoad NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Str Expr Call AttributeLoad NameLoad attr NameLoad TupleLoad NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Return TupleLoad NameLoad NameLoad decorator_list Return Call AttributeLoad NameLoad attr Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str FunctionDef arguments args NameParam defaults body Assign NameStore Str Expr Call AttributeLoad NameLoad attr NameLoad TupleLoad NameLoad NameLoad Assign NameStore DictComp SubscriptLoad NameLoad Index Num Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num comprehension NameStore Call AttributeLoad NameLoad attr Assign NameStore Str Expr Call AttributeLoad NameLoad attr NameLoad TupleLoad NameLoad NameLoad Assign NameStore Dict For NameStore Call AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num Dict Assign SubscriptStore NameLoad Index SubscriptLoad NameLoad Index Num Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num Return TupleLoad NameLoad NameLoad decorator_list Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Call NameLoad NameLoad If UnaryOpNot NameLoad body Return TupleLoad Dict Dict Return Call AttributeLoad NameLoad attr Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr NameLoad keyword Str keyword Dict Str Str Str NameLoad NameLoad NameLoad keyword Dict Str Str NameLoad NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list With Call AttributeLoad AttributeLoad NameLoad attr attr NameStore body Expr Yield Call AttributeLoad NameLoad attr Str NameLoad NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr NameLoad decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr NameLoad keyword Str keyword Dict Str Str NameLoad NameLoad keyword Dict Str Str NameLoad NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list With Call AttributeLoad AttributeLoad NameLoad attr attr NameStore body Expr Yield Call AttributeLoad NameLoad attr Str NameLoad NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr NameLoad decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Str Expr Call AttributeLoad NameLoad attr NameLoad TupleLoad NameLoad NameLoad decorator_list decorator_list
N/A _base SQLBaseStore twisted.internet defer N/A ujson json N/A logging N/A logger N/A N/A logging getLogger __name__ AccountDataStore N/A SQLBaseStore N/A get_account_data_for_user N/A N/A self user_id N/A N/A N/A Get all the client account_data for a user.

        Args:
            user_id(str): The user to get the account_data for.
        Returns:
            A deferred pair of a dict of global account_data and a dict
            mapping from room_id string to per room account_data dicts.
         get_account_data_for_user_txn N/A N/A txn N/A N/A N/A rows N/A N/A self _simple_select_list_txn txn account_data N/A user_id user_id N/A account_data_type content N/A global_account_data N/A N/A row N/A account_data_type N/A N/A json loads N/A row N/A content N/A row rows N/A rows N/A N/A self _simple_select_list_txn txn room_account_data N/A user_id user_id N/A room_id account_data_type content N/A by_room N/A N/A row rows N/A N/A room_data N/A N/A by_room setdefault N/A row N/A room_id N/A N/A N/A room_data N/A N/A row N/A account_data_type N/A N/A json loads N/A row N/A content N/A N/A global_account_data by_room N/A N/A N/A N/A self runInteraction get_account_data_for_user get_account_data_for_user_txn N/A get_account_data_for_room N/A N/A self user_id room_id N/A N/A N/A Get all the client account_data for a user for a room.

        Args:
            user_id(str): The user to get the account_data for.
            room_id(str): The room to get the account_data for.
        Returns:
            A deferred dict of the room account_data
         get_account_data_for_room_txn N/A N/A txn N/A N/A N/A rows N/A N/A self _simple_select_list_txn txn room_account_data N/A user_id room_id user_id room_id N/A account_data_type content N/A N/A N/A row N/A account_data_type N/A N/A json loads N/A row N/A content N/A row rows N/A N/A N/A N/A self runInteraction get_account_data_for_room get_account_data_for_room_txn N/A get_all_updated_account_data N/A N/A self last_global_id last_room_id current_id limit N/A N/A N/A Get all the client account_data that has changed on the server
        Args:
            last_global_id(int): The position to fetch from for top level data
            last_room_id(int): The position to fetch from for per room data
            current_id(int): The position to fetch up to.
        Returns:
            A deferred pair of lists of tuples of stream_id int, user_id string,
            room_id string, type string, and content string.
         get_updated_account_data_txn N/A N/A txn N/A N/A N/A sql SELECT stream_id, user_id, account_data_type, content FROM account_data WHERE ? < stream_id AND stream_id <= ? ORDER BY stream_id ASC LIMIT ? N/A N/A N/A txn execute sql N/A last_global_id current_id limit N/A global_results N/A N/A txn fetchall N/A sql SELECT stream_id, user_id, room_id, account_data_type, content FROM room_account_data WHERE ? < stream_id AND stream_id <= ? ORDER BY stream_id ASC LIMIT ? N/A N/A N/A txn execute sql N/A last_room_id current_id limit N/A room_results N/A N/A txn fetchall N/A N/A global_results room_results N/A N/A N/A N/A self runInteraction get_all_updated_account_data_txn get_updated_account_data_txn N/A get_updated_account_data_for_user N/A N/A self user_id stream_id N/A N/A N/A Get all the client account_data for a that's changed for a user

        Args:
            user_id(str): The user to get the account_data for.
            stream_id(int): The point in the stream since which to get updates
        Returns:
            A deferred pair of a dict of global account_data and a dict
            mapping from room_id string to per room account_data dicts.
         get_updated_account_data_for_user_txn N/A N/A txn N/A N/A N/A sql SELECT account_data_type, content FROM account_data WHERE user_id = ? AND stream_id > ? N/A N/A N/A txn execute sql N/A user_id stream_id N/A global_account_data N/A N/A row N/A 0 N/A N/A json loads N/A row N/A 1 N/A row N/A N/A txn fetchall N/A sql SELECT room_id, account_data_type, content FROM room_account_data WHERE user_id = ? AND stream_id > ? N/A N/A N/A txn execute sql N/A user_id stream_id N/A account_data_by_room N/A N/A row N/A N/A txn fetchall N/A N/A room_account_data N/A N/A account_data_by_room setdefault N/A row N/A 0 N/A N/A N/A room_account_data N/A N/A row N/A 1 N/A N/A json loads N/A row N/A 2 N/A N/A global_account_data account_data_by_room N/A N/A changed N/A N/A N/A self _account_data_stream_cache has_entity_changed user_id N/A int stream_id N/A N/A changed N/A N/A N/A N/A N/A N/A N/A N/A self runInteraction get_updated_account_data_for_user get_updated_account_data_for_user_txn N/A add_account_data_to_room N/A N/A self user_id room_id account_data_type content N/A N/A N/A Add some account_data to a room for a user.
        Args:
            user_id(str): The user to add a tag for.
            room_id(str): The room to add a tag for.
            account_data_type(str): The type of account_data to add.
            content(dict): A json object to associate with the tag.
        Returns:
            A deferred that completes once the account_data has been added.
         N/A content_json N/A N/A json dumps content add_account_data_txn N/A N/A txn next_id N/A N/A N/A N/A N/A self _simple_upsert_txn txn table room_account_data keyvalues N/A user_id room_id account_data_type user_id room_id account_data_type values N/A stream_id content next_id content_json N/A N/A N/A txn call_after N/A N/A self _account_data_stream_cache entity_has_changed user_id next_id N/A N/A N/A self _update_max_stream_id txn next_id N/A N/A N/A N/A N/A self _account_data_id_gen get_next next_id N/A N/A N/A N/A N/A self runInteraction add_room_account_data add_account_data_txn next_id N/A result N/A N/A N/A self _account_data_id_gen get_max_token N/A N/A N/A defer returnValue result N/A N/A defer inlineCallbacks add_account_data_for_user N/A N/A self user_id account_data_type content N/A N/A N/A Add some account_data to a room for a user.
        Args:
            user_id(str): The user to add a tag for.
            account_data_type(str): The type of account_data to add.
            content(dict): A json object to associate with the tag.
        Returns:
            A deferred that completes once the account_data has been added.
         N/A content_json N/A N/A json dumps content add_account_data_txn N/A N/A txn next_id N/A N/A N/A N/A N/A self _simple_upsert_txn txn table account_data keyvalues N/A user_id account_data_type user_id account_data_type values N/A stream_id content next_id content_json N/A N/A N/A txn call_after N/A N/A self _account_data_stream_cache entity_has_changed user_id next_id N/A N/A N/A self _update_max_stream_id txn next_id N/A N/A N/A N/A N/A self _account_data_id_gen get_next next_id N/A N/A N/A N/A N/A self runInteraction add_user_account_data add_account_data_txn next_id N/A result N/A N/A N/A self _account_data_id_gen get_max_token N/A N/A N/A defer returnValue result N/A N/A defer inlineCallbacks _update_max_stream_id N/A N/A self txn next_id N/A N/A N/A Update the max stream_id

        Args:
            txn: The database cursor
            next_id(int): The the revision to advance to.
         N/A update_max_id_sql UPDATE account_data_max_stream_id SET stream_id = ? WHERE stream_id < ? N/A N/A N/A txn execute update_max_id_sql N/A next_id next_id N/A N/A