def update_to_dict_cache(changed_messages):
 items_for_remote_cache = {}
 message_ids = []
 for changed_message in changed_messages:
  message_ids.append(changed_message.id)
  items_for_remote_cache[to_dict_cache_key(changed_message, True)] = (MessageDict.to_dict_uncached(changed_message, apply_markdown=True),)
  items_for_remote_cache[to_dict_cache_key(changed_message, False)] = (MessageDict.to_dict_uncached(changed_message, apply_markdown=False),)
 cache_set_many(items_for_remote_cache)
 return message_ids

def update_to_dict_cache ( changed_messages ) : items_for_remote_cache = { } message_ids = [ ] for changed_message in changed_messages : message_ids . append ( changed_message . id ) items_for_remote_cache [ to_dict_cache_key ( changed_message , True ) ] = ( MessageDict . to_dict_uncached ( changed_message , apply_markdown = True ) , ) items_for_remote_cache [ to_dict_cache_key ( changed_message , False ) ] = ( MessageDict . to_dict_uncached ( changed_message , apply_markdown = False ) , ) cache_set_many ( items_for_remote_cache ) return message_ids
updates the message as stored in the to_dict cache .