diff --git a/python/src/deltachat/message.py b/python/src/deltachat/message.py index d15c1696e..ddab1069b 100644 --- a/python/src/deltachat/message.py +++ b/python/src/deltachat/message.py @@ -8,7 +8,6 @@ from typing import Optional, Union from . import const, props from .capi import ffi, lib from .cutil import as_dc_charpointer, from_dc_charpointer, from_optional_dc_charpointer -from .reactions import Reactions class Message: @@ -164,17 +163,6 @@ class Message: ), ) - def send_reaction(self, reaction: str): - """Send a reaction to message and return the resulting Message instance.""" - msg_id = lib.dc_send_reaction(self.account._dc_context, self.id, as_dc_charpointer(reaction)) - if msg_id == 0: - raise ValueError("reaction could not be send") - return Message.from_db(self.account, msg_id) - - def get_reactions(self) -> Reactions: - """Get :class:`deltachat.reactions.Reactions` to the message.""" - return Reactions.from_msg(self) - def is_system_message(self): """return True if this message is a system/info message.""" return bool(lib.dc_msg_is_info(self._dc_msg)) diff --git a/python/src/deltachat/reactions.py b/python/src/deltachat/reactions.py deleted file mode 100644 index 9838174ce..000000000 --- a/python/src/deltachat/reactions.py +++ /dev/null @@ -1,43 +0,0 @@ -"""The Reactions object.""" - -from .capi import ffi, lib -from .cutil import from_dc_charpointer, iter_array - - -class Reactions: - """Reactions object. - - You obtain instances of it through :class:`deltachat.message.Message`. - """ - - def __init__(self, account, dc_reactions) -> None: - assert isinstance(account._dc_context, ffi.CData) - assert isinstance(dc_reactions, ffi.CData) - assert dc_reactions != ffi.NULL - self.account = account - self._dc_reactions = dc_reactions - - def __repr__(self) -> str: - return f"" - - @classmethod - def from_msg(cls, msg): - assert msg.id > 0 - return cls( - msg.account, - ffi.gc(lib.dc_get_msg_reactions(msg.account._dc_context, msg.id), lib.dc_reactions_unref), - ) - - def get_contacts(self) -> list: - """Get list of contacts reacted to the message. - - :returns: list of :class:`deltachat.contact.Contact` objects for this reaction. - """ - from .contact import Contact - - dc_array = ffi.gc(lib.dc_reactions_get_contacts(self._dc_reactions), lib.dc_array_unref) - return list(iter_array(dc_array, lambda x: Contact(self.account, x))) - - def get_by_contact(self, contact) -> str: - """Get a string containing space-separated reactions of a single :class:`deltachat.contact.Contact`.""" - return from_dc_charpointer(lib.dc_reactions_get_by_contact_id(self._dc_reactions, contact.id))