mirror of
https://github.com/Tha14/toxic.git
synced 2025-12-07 15:06:34 +01:00
Fix group ignore functionality
Ignoring a peer now persists if they leave/disconnect and rejoin the group. In addition, ignore status is now displayed in the peer list sidebar as a red # symbol.
This commit is contained in:
@@ -47,6 +47,7 @@ typedef struct GroupPeer {
|
||||
uint8_t public_key[TOX_GROUP_PEER_PUBLIC_KEY_SIZE];
|
||||
TOX_USER_STATUS status;
|
||||
Tox_Group_Role role;
|
||||
bool is_ignored;
|
||||
uint64_t last_active;
|
||||
} GroupPeer;
|
||||
|
||||
@@ -56,6 +57,9 @@ typedef struct {
|
||||
uint32_t num_peers; /* Number of peers in the chat/name_list array */
|
||||
uint32_t max_idx; /* Maximum peer list index - 1 */
|
||||
|
||||
uint8_t **ignored_list; /* List of keys of peers that we're ignoring */
|
||||
uint16_t num_ignored;
|
||||
|
||||
char group_name[TOX_GROUP_MAX_GROUP_NAME_LENGTH + 1];
|
||||
size_t group_name_length;
|
||||
uint32_t groupnumber;
|
||||
@@ -108,4 +112,9 @@ void redraw_groupchat_win(ToxWindow *self);
|
||||
*/
|
||||
GroupChat *get_groupchat(uint32_t groupnumber);
|
||||
|
||||
/**
|
||||
* Toggles the ignore status of the peer associated with `peer_id`.
|
||||
*/
|
||||
void group_toggle_peer_ignore(uint32_t groupnumber, int peer_id, bool ignore);
|
||||
|
||||
#endif /* #define GROUPCHATS_H */
|
||||
|
||||
Reference in New Issue
Block a user