Skip to content

Groups Info

groups_info_destroy_group

Nukes a group from orbit. This is permanent (i.e. there is no removing this setting once set).

Declaration

LIBSESSION_EXPORT void groups_info_destroy_group(config_object* conf);

Parameters

  • conf — [in] Pointer to the config object

Returns

groups_info_get_attach_delete_before

Returns the delete-before timestamp (unix time, in seconds) for attachments; clients should drop all attachments from messages from the group with timestamps earlier than this value, if set.

Declaration

LIBSESSION_EXPORT int64_t groups_info_get_attach_delete_before(const config_object* conf);

Parameters

  • conf — [in] Pointer to the config object

Returns

  • int64_t — Unix timestamp before which messages should be deleted. Returns 0 if not set.

groups_info_get_created

Returns the timestamp (unix time, in seconds) when the group was created. Returns 0 if unset.

Declaration

LIBSESSION_EXPORT int64_t groups_info_get_created(const config_object* conf);

Parameters

  • conf — [in] Pointer to the config object

Returns

  • int64_t — Unix timestamp when the group was created (if set by an admin).

groups_info_get_delete_before

Returns the delete-before timestamp (unix time, in seconds); clients should delete all messages from the group with timestamps earlier than this value, if set.

Declaration

LIBSESSION_EXPORT int64_t groups_info_get_delete_before(const config_object* conf);

Parameters

  • conf — [in] Pointer to the config object

Returns

  • int64_t — Unix timestamp before which messages should be deleted. Returns 0 if not set.

groups_info_get_description

Returns a pointer to the currently-set description (null-terminated), or NULL if there is no description at all. Should be copied right away as the pointer may not remain valid beyond other API calls.

Declaration

LIBSESSION_EXPORT const char* groups_info_get_description(const config_object* conf);

Parameters

  • conf — [in] Pointer to the config object

Returns

  • char* — Pointer to the currently-set description as a null-terminated string, or NULL if there is no description

groups_info_get_expiry_timer

Gets the group's message expiry timer (seconds). Returns 0 if not set.

Declaration

LIBSESSION_EXPORT int groups_info_get_expiry_timer(const config_object* conf);

Parameters

  • conf — [in] Pointer to the config object

Returns

  • int — Returns the expiry timer in seconds. Returns 0 if not set

groups_info_get_name

Returns a pointer to the currently-set name (null-terminated), or NULL if there is no name at all. Should be copied right away as the pointer may not remain valid beyond other API calls.

Declaration

LIBSESSION_EXPORT const char* groups_info_get_name(const config_object* conf);

Parameters

  • conf — [in] Pointer to the config object

Returns

  • char* — Pointer to the currently-set name as a null-terminated string, or NULL if there is no name

groups_info_get_pic

Obtains the current profile pic. The pointers in the returned struct will be NULL if a profile pic is not currently set, and otherwise should be copied right away (they will not be valid beyond other API calls on this config object).

Declaration

LIBSESSION_EXPORT user_profile_pic groups_info_get_pic(const config_object* conf);

Parameters

  • conf — [in] Pointer to the config object

Returns

  • user_profile_pic — Pointer to the currently-set profile pic (despite the "user_profile" in the struct name, this is the group's profile pic).

groups_info_is_destroyed

Returns true if this group has been marked destroyed by an admin, which indicates to a receiving client that they should destroy it locally.

Declaration

LIBSESSION_EXPORT bool groups_info_is_destroyed(const config_object* conf);

Parameters

  • conf — [in] Pointer to the config object

Returns

  • true if the group has been nuked, false otherwise.

groups_info_set_attach_delete_before

Sets the delete-before time (unix timestamp, in seconds) for attachments; attachments should be dropped from messages older than this value. Setting 0 clears the value.

Declaration

LIBSESSION_EXPORT void groups_info_set_attach_delete_before(config_object* conf, int64_t ts);

Parameters

  • conf — [in] Pointer to the config object
  • ts — [in] the unix timestamp, or 0 to clear a current value.

Returns

groups_info_set_created

Sets the creation time (unix timestamp, in seconds) when the group was created. Setting 0 clears the value.

Declaration

LIBSESSION_EXPORT void groups_info_set_created(config_object* conf, int64_t ts);

Parameters

  • conf — [in] Pointer to the config object
  • ts — [in] the unix timestamp, or 0 to clear a current value.

Returns

groups_info_set_delete_before

Sets the delete-before time (unix timestamp, in seconds) before which messages should be deleted. Setting 0 clears the value.

Declaration

LIBSESSION_EXPORT void groups_info_set_delete_before(config_object* conf, int64_t ts);

Parameters

  • conf — [in] Pointer to the config object
  • ts — [in] the unix timestamp, or 0 to clear a current value.

Returns

groups_info_set_description

Sets the group's description to the null-terminated C string. Returns 0 on success, non-zero on error (and sets the config_object's error string).

If the given description is longer than GROUP_INFO_DESCRIPTION_MAX_LENGTH (2000) bytes then it will be truncated.

Declaration

LIBSESSION_EXPORT int groups_info_set_description(config_object* conf, const char* description);

Parameters

  • conf — [in] Pointer to the config object
  • description — [in] Pointer to the description as a null-terminated C string

Returns

  • int — Returns 0 on success, non-zero on error

groups_info_set_expiry_timer

Sets the group's message expiry timer (seconds). Setting 0 (or negative) will clear the current timer.

Declaration

LIBSESSION_EXPORT void groups_info_set_expiry_timer(config_object* conf, int expiry);

Parameters

  • conf — [in] Pointer to the config object
  • expiry — [in] Integer of the expiry timer in seconds

Returns

groups_info_set_name

Sets the group's name to the null-terminated C string. Returns 0 on success, non-zero on error (and sets the config_object's error string).

If the given name is longer than GROUP_INFO_NAME_MAX_LENGTH (100) bytes then it will be truncated.

Declaration

LIBSESSION_EXPORT int groups_info_set_name(config_object* conf, const char* name);

Parameters

  • conf — [in] Pointer to the config object
  • name — [in] Pointer to the name as a null-terminated C string

Returns

  • int — Returns 0 on success, non-zero on error

groups_info_set_pic

Sets a user profile

Declaration

LIBSESSION_EXPORT int groups_info_set_pic(config_object* conf, user_profile_pic pic);

Parameters

  • conf — [in] Pointer to the config object
  • pic — [in] Pointer to the pic

Returns

  • int — Returns 0 on success, non-zero on error