/*
 * SPDX-FileCopyrightText: 2003-2026 Sébastien Helleu <flashcode@flashtux.org>
 *
 * SPDX-License-Identifier: GPL-3.0-or-later
 */

#ifndef WEECHAT_PLUGIN_RELAY_WEECHAT_NICKLIST_H
#define WEECHAT_PLUGIN_RELAY_WEECHAT_NICKLIST_H

#define RELAY_WEECHAT_NICKLIST_DIFF_UNKNOWN ' '
#define RELAY_WEECHAT_NICKLIST_DIFF_PARENT  '^'
#define RELAY_WEECHAT_NICKLIST_DIFF_ADDED   '+'
#define RELAY_WEECHAT_NICKLIST_DIFF_REMOVED '-'
#define RELAY_WEECHAT_NICKLIST_DIFF_CHANGED '*'

struct t_relay_weechat_nicklist_item
{
    void *pointer;                     /* pointer on group/nick             */
    char diff;                         /* type of diff (see constants above)*/
    char group;                        /* 1=group, 0=nick                   */
    char visible;                      /* 1=visible, 0=not visible          */
    int level;                         /* level                             */
    char *name;                        /* name of group/nick                */
    char *color;                       /* color for name                    */
    char *prefix;                      /* prefix                            */
    char *prefix_color;                /* color for prefix                  */
};

struct t_relay_weechat_nicklist
{
    int nicklist_count;                /* number of nicks in nicklist       */
                                       /* before receiving first diff       */
    int items_count;                   /* number of nicklist items          */
    struct t_relay_weechat_nicklist_item *items; /* nicklist items          */
};

extern struct t_relay_weechat_nicklist *relay_weechat_nicklist_new (void);
extern void relay_weechat_nicklist_add_item (struct t_relay_weechat_nicklist *nicklist,
                                             char diff,
                                             struct t_gui_nick_group *group,
                                             struct t_gui_nick *nick);
extern void relay_weechat_nicklist_free (struct t_relay_weechat_nicklist *nicklist);

#endif /* WEECHAT_PLUGIN_RELAY_WEECHAT_NICKLIST_H */
