Mercurial > ~mikael > mcabber > hg
diff mcabber/src/roster.c @ 1377:cd9182f0b5c7
Add /room setopt {print_status,auto_whois}
- add the command /room setopt
- add option 'muc_auto_whois'
The MUC settings auto_whois and print_status can be set on
a per-room basis.
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Tue, 27 Nov 2007 23:57:20 +0100 |
parents | 01e558748379 |
children | cefda9174d62 |
line wrap: on
line diff
--- a/mcabber/src/roster.c Fri Nov 23 21:56:58 2007 +0100 +++ b/mcabber/src/roster.c Tue Nov 27 23:57:20 2007 +0100 @@ -25,14 +25,14 @@ #include "utils.h" -char *strrole[] = { /* Should match enum in roster.h */ +char *strrole[] = { /* Should match enum in roster.h */ "none", "moderator", "participant", "visitor" }; -char *straffil[] = { /* Should match enum roster.h */ +char *straffil[] = { /* Should match enum in roster.h */ "none", "owner", "admin", @@ -40,6 +40,19 @@ "outcast" }; +char *strprintstatus[] = { /* Should match enum in roster.h */ + "default", + "none", + "in_and_out", + "all" +}; + +char *strautowhois[] = { /* Should match enum in roster.h */ + "default", + "off", + "on", +}; + /* Resource structure */ typedef struct { @@ -76,6 +89,8 @@ gchar *nickname; gchar *topic; guint inside_room; + guint print_status; + guint auto_whois; /* on_server is TRUE if the item is present on the server roster */ guint on_server; @@ -1026,6 +1041,30 @@ return roster_usr->topic; } +void buddy_setprintstatus(gpointer rosterdata, enum room_printstatus pstatus) +{ + roster *roster_usr = rosterdata; + roster_usr->print_status = pstatus; +} + +enum room_printstatus buddy_getprintstatus(gpointer rosterdata) +{ + roster *roster_usr = rosterdata; + return roster_usr->print_status; +} + +void buddy_setautowhois(gpointer rosterdata, enum room_autowhois awhois) +{ + roster *roster_usr = rosterdata; + roster_usr->auto_whois = awhois; +} + +enum room_autowhois buddy_getautowhois(gpointer rosterdata) +{ + roster *roster_usr = rosterdata; + return roster_usr->auto_whois; +} + // buddy_getgroupname() // Returns a pointer on buddy's group name. const char *buddy_getgroupname(gpointer rosterdata)