Merge pull request #2334 from deltachat/adb-issue-2329

Add "override_sender_name" API
This commit is contained in:
Asiel Díaz Benítez
2021-04-16 15:23:31 -04:00
committed by GitHub
2 changed files with 46 additions and 0 deletions

View File

@@ -236,6 +236,20 @@ class Message(object):
chat_id = lib.dc_msg_get_chat_id(self._dc_msg)
return Chat(self.account, chat_id)
@props.with_doc
def override_sender_name(self):
"""the name that should be shown over the message instead of the contact display name.
Usually used to impersonate someone else.
"""
return from_dc_charpointer(
lib.dc_msg_get_override_sender_name(self._dc_msg))
def set_override_sender_name(self, name):
"""set different sender name for a message. """
lib.dc_msg_set_override_sender_name(
self._dc_msg, as_dc_charpointer(name))
def get_sender_chat(self):
"""return the 1:1 chat with the sender of this message.