view mcabber/src/roster.h @ 78:d001d8fb876d

[/trunk] Changeset 92 by mikael * Improve roster. Next step is to switch to it, from "buddies".
author mikael
date Sat, 16 Apr 2005 20:34:00 +0000
parents 9b7f0d313e33
children ff8046b6de02
line wrap: on
line source

#ifndef __ROSTER_H__
#define __ROSTER_H__ 1

#include <glib.h>

# include "test_roster_main.h"
# include "jabglue.h"

enum findwhat {

// Roster_type is a set of flags, so values should be 2^n
#define ROSTER_TYPE_USER    1

// Flags:
#define ROSTER_FLAG_MSG     1   // Message not read
#define ROSTER_FLAG_HIDE    2   // Group hidden (or buddy window closed)
#define ROSTER_FLAG_LOCK    4   // Node should not be removed from buddylist
// ROSTER_FLAG_LOCAL   8   // Buddy not on server's roster  (??)

extern GList *buddylist;
extern GList *current_buddy;

// Macros...

#define CURRENT_JID     buddy_getjid(current_buddy->data)

// Prototypes...
GSList *roster_add_group(const char *name);
GSList *roster_add_user(const char *jid, const char *name, const char *group,
        guint type);
void    roster_del_user(const char *jid);
void    roster_setstatus(const char *jid, enum imstatus bstat);

void buddylist_hide_offline_buddies(int hide);
void buddy_hide_group(gpointer rosterdata, int hide);
void buddylist_build(void);
const char *buddy_getjid(gpointer rosterdata);
const char *buddy_getname(gpointer rosterdata);
guint buddy_gettype(gpointer rosterdata);
enum imstatus buddy_getstatus(gpointer rosterdata);
guint buddy_getflags(gpointer rosterdata);

#endif /* __ROSTER_H__ */