From dc6fb7d481083a7809ef69a7ae502db5359fbbda Mon Sep 17 00:00:00 2001 From: adbenitez Date: Tue, 6 Apr 2021 21:16:35 -0400 Subject: [PATCH] add "override_sender_name" API --- python/src/deltachat/message.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/python/src/deltachat/message.py b/python/src/deltachat/message.py index 07906ff32..a13dca895 100644 --- a/python/src/deltachat/message.py +++ b/python/src/deltachat/message.py @@ -227,6 +227,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.