Skip to content
This repository has been archived by the owner on Nov 25, 2022. It is now read-only.

Commit

Permalink
Merge branch 'master' into patch-3
Browse files Browse the repository at this point in the history
  • Loading branch information
hpk42 authored May 23, 2019
2 parents 7b577ff + f583674 commit 7095142
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions python/src/deltachat/chatting.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def send_text(self, text):
""" send a text message and return the resulting Message instance.
:param msg: unicode text
:raises: ValueError if message can not be send/chat does not exist.
:raises ValueError: if message can not be send/chat does not exist.
:returns: the resulting :class:`deltachat.message.Message` instance
"""
msg = as_dc_charpointer(text)
Expand All @@ -133,7 +133,7 @@ def send_file(self, path, mime_type="application/octet-stream"):
:param path: path to the file.
:param mime_type: the mime-type of this file, defaults to application/octet-stream.
:raises: ValueError if message can not be send/chat does not exist.
:raises ValueError: if message can not be send/chat does not exist.
:returns: the resulting :class:`deltachat.message.Message` instance
"""
path = as_dc_charpointer(path)
Expand All @@ -149,7 +149,7 @@ def send_image(self, path):
""" send an image message and return the resulting Message instance.
:param path: path to an image file.
:raises: ValueError if message can not be send/chat does not exist.
:raises ValueError: if message can not be send/chat does not exist.
:returns: the resulting :class:`deltachat.message.Message` instance
"""
if not os.path.exists(path):
Expand All @@ -168,7 +168,7 @@ def prepare_file(self, path, mime_type=None, view_type="file"):
:param path: path to the file.
:param mime_type: the mime-type of this file, defaults to auto-detection.
:param view_type: passed to :meth:`MessageType.new`.
:raises: ValueError if message can not be prepared/chat does not exist.
:raises ValueError: if message can not be prepared/chat does not exist.
:returns: the resulting :class:`Message` instance
"""
path = as_dc_charpointer(path)
Expand All @@ -185,7 +185,7 @@ def send_prepared(self, message):
:param message: a :class:`Message` instance previously returned by
:meth:`prepare_file`.
:raises: ValueError if message can not be sent.
:raises ValueError: if message can not be sent.
:returns: a :class:`deltachat.message.Message` instance with updated state
"""
msg_id = lib.dc_send_msg(self._dc_context, 0, message._dc_msg)
Expand Down Expand Up @@ -224,7 +224,7 @@ def add_contact(self, contact):
""" add a contact to this chat.
:params: contact object.
:exception: ValueError if contact could not be added
:raises ValueError: if contact could not be added
:returns: None
"""
ret = lib.dc_add_contact_to_chat(self._dc_context, self.id, contact.id)
Expand All @@ -235,7 +235,7 @@ def remove_contact(self, contact):
""" remove a contact from this chat.
:params: contact object.
:exception: ValueError if contact could not be removed
:raises ValueError: if contact could not be removed
:returns: None
"""
ret = lib.dc_remove_contact_from_chat(self._dc_context, self.id, contact.id)
Expand All @@ -244,9 +244,10 @@ def remove_contact(self, contact):

def get_contacts(self):
""" get all contacts for this chat.
:exception: ValueError if contact could not be added
:params: contact object.
:raises ValueError: if contact could not be added
:returns: list of :class:`deltachat.chatting.Contact` objects for this chat
"""
dc_array = ffi.gc(
lib.dc_get_chat_contacts(self._dc_context, self.id),
Expand Down

0 comments on commit 7095142

Please sign in to comment.