'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.'

@defer.inlineCallbacks
def add_account_data_for_user(self, user_id, account_data_type, content):

    content_json = json.dumps(content)
    def add_account_data_txn(txn, next_id):
        self._simple_upsert_txn(txn, table='account_data', keyvalues={'user_id': user_id, 'account_data_type': account_data_type}, values={'stream_id': next_id, 'content': content_json})
        txn.call_after(self._account_data_stream_cache.entity_has_changed, user_id, next_id)
        txn.call_after(self.get_account_data_for_user.invalidate, (user_id,))
        txn.call_after(self.get_global_account_data_by_type_for_user.invalidate, (account_data_type, user_id))
        self._update_max_stream_id(txn, next_id)
    with self._account_data_id_gen.get_next() as next_id:
        (yield self.runInteraction('add_user_account_data', add_account_data_txn, next_id))
    result = self._account_data_id_gen.get_current_token()
    defer.returnValue(result)
