comparison 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
comparison
equal deleted inserted replaced
1376:a0deb5124ebf 1377:cd9182f0b5c7
23 23
24 #include "roster.h" 24 #include "roster.h"
25 #include "utils.h" 25 #include "utils.h"
26 26
27 27
28 char *strrole[] = { /* Should match enum in roster.h */ 28 char *strrole[] = { /* Should match enum in roster.h */
29 "none", 29 "none",
30 "moderator", 30 "moderator",
31 "participant", 31 "participant",
32 "visitor" 32 "visitor"
33 }; 33 };
34 34
35 char *straffil[] = { /* Should match enum roster.h */ 35 char *straffil[] = { /* Should match enum in roster.h */
36 "none", 36 "none",
37 "owner", 37 "owner",
38 "admin", 38 "admin",
39 "member", 39 "member",
40 "outcast" 40 "outcast"
41 };
42
43 char *strprintstatus[] = { /* Should match enum in roster.h */
44 "default",
45 "none",
46 "in_and_out",
47 "all"
48 };
49
50 char *strautowhois[] = { /* Should match enum in roster.h */
51 "default",
52 "off",
53 "on",
41 }; 54 };
42 55
43 /* Resource structure */ 56 /* Resource structure */
44 57
45 typedef struct { 58 typedef struct {
74 87
75 /* For groupchats */ 88 /* For groupchats */
76 gchar *nickname; 89 gchar *nickname;
77 gchar *topic; 90 gchar *topic;
78 guint inside_room; 91 guint inside_room;
92 guint print_status;
93 guint auto_whois;
79 94
80 /* on_server is TRUE if the item is present on the server roster */ 95 /* on_server is TRUE if the item is present on the server roster */
81 guint on_server; 96 guint on_server;
82 97
83 /* To keep track of last status message */ 98 /* To keep track of last status message */
1024 { 1039 {
1025 roster *roster_usr = rosterdata; 1040 roster *roster_usr = rosterdata;
1026 return roster_usr->topic; 1041 return roster_usr->topic;
1027 } 1042 }
1028 1043
1044 void buddy_setprintstatus(gpointer rosterdata, enum room_printstatus pstatus)
1045 {
1046 roster *roster_usr = rosterdata;
1047 roster_usr->print_status = pstatus;
1048 }
1049
1050 enum room_printstatus buddy_getprintstatus(gpointer rosterdata)
1051 {
1052 roster *roster_usr = rosterdata;
1053 return roster_usr->print_status;
1054 }
1055
1056 void buddy_setautowhois(gpointer rosterdata, enum room_autowhois awhois)
1057 {
1058 roster *roster_usr = rosterdata;
1059 roster_usr->auto_whois = awhois;
1060 }
1061
1062 enum room_autowhois buddy_getautowhois(gpointer rosterdata)
1063 {
1064 roster *roster_usr = rosterdata;
1065 return roster_usr->auto_whois;
1066 }
1067
1029 // buddy_getgroupname() 1068 // buddy_getgroupname()
1030 // Returns a pointer on buddy's group name. 1069 // Returns a pointer on buddy's group name.
1031 const char *buddy_getgroupname(gpointer rosterdata) 1070 const char *buddy_getgroupname(gpointer rosterdata)
1032 { 1071 {
1033 roster *roster_usr = rosterdata; 1072 roster *roster_usr = rosterdata;