MCPcopy Create free account
hub / github.com/chatmail/core / set_profile_image

Method set_profile_image

python/src/deltachat/chat.py:428–442  ·  view source on GitHub ↗

Set group profile image. If the group is already promoted (any message was sent to the group), all group members are informed by a special status message that is sent automatically by this function. :params img_path: path to image object :raises ValueError: i

(self, img_path)

Source from the content-addressed store, hash-verified

426 return lib.dc_array_get_cnt(dc_array)
427
428 def set_profile_image(self, img_path):
429 """Set group profile image.
430
431 If the group is already promoted (any message was sent to the group),
432 all group members are informed by a special status message that is sent
433 automatically by this function.
434 :params img_path: path to image object
435 :raises ValueError: if profile image could not be set
436 :returns: None
437 """
438 assert os.path.exists(img_path), img_path
439 p = as_dc_charpointer(img_path)
440 res = lib.dc_set_chat_profile_image(self.account._dc_context, self.id, p)
441 if res != 1:
442 raise ValueError(f"Setting Profile Image {p!r} failed")
443
444 def remove_profile_image(self):
445 """remove group profile image.

Callers 2

test_set_get_group_imageFunction · 0.80

Calls 2

as_dc_charpointerFunction · 0.85
existsMethod · 0.45

Tested by 2

test_set_get_group_imageFunction · 0.64