Implement a per-connection-class default usermode option.
[ircu2.10.12-pk.git] / ircd / client.c
index e12546651a6caf0b185355bb27729456e9117906..0b4e4f93daed6282a1bc688e7e69a4e9116f728d 100644 (file)
@@ -67,6 +67,25 @@ int client_get_ping(const struct Client* acptr)
   return ping;
 }
 
+/*
+ * client_get_default_umode
+ * returns default usermode in attached client connection class
+ */
+const char* client_get_default_umode(const struct Client* sptr)
+{
+  struct ConfItem* aconf;
+  struct SLink* link;
+
+  assert(cli_verify(sptr));
+
+  for (link = cli_confs(sptr); link; link = link->next) {
+    aconf = link->value.aconf;
+    if ((aconf->status & CONF_CLIENT) && ConfUmode(aconf))
+      return ConfUmode(aconf);
+  }
+  return NULL;
+}
+
 /*
  * client_drop_sendq
  * removes the client's connection from the list of connections with