]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - src/supported.c
presence: Broadcast presence changes to peer clients with CLICAP_PRESENCE.
[irc/rqf/shadowircd.git] / src / supported.c
index b062d55d2c4076922c68dd424243271ad74c40f3..f34562e3fab339df8d3454c5d0a47abb16455c92 100644 (file)
@@ -87,6 +87,7 @@
 #include "ircd.h"
 #include "s_conf.h"
 #include "supported.h"
+#include "chmode.h"
 
 rb_dlink_list isupportlist;
 
@@ -110,6 +111,32 @@ add_isupport(const char *name, const char *(*func)(const void *), const void *pa
        rb_dlinkAddTail(item, &item->node, &isupportlist);
 }
 
+const void *
+change_isupport(const char *name, const char *(*func)(const void *), const void *param)
+{
+       rb_dlink_node *ptr;
+       struct isupportitem *item;
+       const void *oldvalue;
+
+       RB_DLINK_FOREACH(ptr, isupportlist.head)
+       {
+               item = ptr->data;
+
+               if (!strcmp(item->name, name))
+               {
+                       oldvalue = item->param;
+
+                       // item->name = name;
+                       item->func = func;
+                       item->param = param;
+
+                       break;
+               }
+       }
+
+       return oldvalue;
+}
+
 void
 delete_isupport(const char *name)
 {
@@ -209,12 +236,11 @@ isupport_chanmodes(const void *ptr)
 {
        static char result[80];
 
-       rb_snprintf(result, sizeof result, "%s%sbq,k,%slj,imnpst%scgzLP%s",
+       rb_snprintf(result, sizeof result, "%s%sbq,k,%slj,%s",
                        ConfigChannel.use_except ? "e" : "",
                        ConfigChannel.use_invex ? "I" : "",
                        ConfigChannel.use_forward ? "f" : "",
-                       rb_dlink_list_length(&service_list) ? "r" : "",
-                       ConfigChannel.use_forward ? "QF" : "");
+                       cflagsbuf);
        return result;
 }
 
@@ -298,4 +324,5 @@ init_isupport(void)
        add_isupport("FNC", isupport_string, "");
        add_isupport("TARGMAX", isupport_targmax, NULL);
        add_isupport("EXTBAN", isupport_extban, NULL);
+       add_isupport("WHOX", isupport_string, "");
 }