]> jfr.im git - irc/freenode/ircd-seven.git/commitdiff
Apply extended-join client cap to QJM joins
authorStephen Bennett <redacted>
Sat, 12 Nov 2011 14:41:01 +0000 (14:41 +0000)
committerStephen Bennett <redacted>
Sat, 12 Nov 2011 15:00:43 +0000 (15:00 +0000)
include/send.h
src/s_user.c
src/send.c

index d617b74b0ff4b36491617dc46e498a7dbc8b77f3..e2329d1f3d102395e9de3ebba6363e7c291a59b2 100644 (file)
@@ -68,6 +68,8 @@ extern void sendto_channel_local(int type, struct Channel *, const char *, ...)
 extern void sendto_channel_local_butone(struct Client *, int type, struct Channel *, const char *, ...) AFP(4, 5);
 
 extern void sendto_channel_local_with_capability(int type, int caps, int negcaps, struct Channel *, const char *, ...) AFP(5, 6);
+extern void sendto_channel_local_with_capability_butone(struct Client *, int type, int caps, int negcaps, struct Channel *,
+                                                       const char *, ...) AFP(6, 7);
 
 extern void sendto_common_channels_local(struct Client *, int cap, const char *, ...) AFP(3, 4);
 extern void sendto_common_channels_local_butone(struct Client *, int cap, const char *, ...) AFP(3, 4);
index 5fc111877f431065dbbebfa0b639281066c87971..e007effbbd244beb8dad8cf833770e3049f5fcc7 100644 (file)
@@ -1537,8 +1537,13 @@ change_nick_user_host(struct Client *target_p,   const char *nick, const char *use
 
                        *mptr = '\0';
 
-                       sendto_channel_local_butone(target_p, ALL_MEMBERS, chptr, ":%s!%s@%s JOIN :%s",
-                                       nick, user, host, chptr->chname);
+                       sendto_channel_local_with_capability_butone(target_p, ALL_MEMBERS, NOCAPS, CLICAP_EXTENDED_JOIN, chptr,
+                                                                   ":%s!%s@%s JOIN %s", nick, user, host, chptr->chname);
+                       sendto_channel_local_with_capability_butone(target_p, ALL_MEMBERS, CLICAP_EXTENDED_JOIN, NOCAPS, chptr,
+                                                                   ":%s!%s@%s JOIN %s %s :%s", nick, user, host, chptr->chname,
+                                                                   EmptyString(target_p->user->suser) ? "*" : target_p->user->suser,
+                                                                   target_p->info);
+
                        if(*mode)
                                sendto_channel_local_butone(target_p, ALL_MEMBERS, chptr,
                                                ":%s MODE %s +%s %s",
index 4ef4b67ac12bd6ab7c700aaa514d50978b1a7b07..1f9c7ae91f5489f1ce924a5fc6b62f4b0f18ae7d 100644 (file)
@@ -768,33 +768,32 @@ sendto_channel_local(int type, struct Channel *chptr, const char *pattern, ...)
        rb_linebuf_donebuf(&linebuf);
 }
 
-/* sendto_channel_local_with_capability()
+/*
+ * _sendto_channel_local_with_capability_butone()
  *
- * inputs      - flags to send to, caps, negate caps, channel to send to, va_args
- * outputs     - message to local channel members
- * side effects -
+ * Shared implementation of sendto_channel_local_with_capability and sendto_channel_local_with_capability_butone
  */
-void
-sendto_channel_local_with_capability(int type, int caps, int negcaps, struct Channel *chptr, const char *pattern, ...)
+static void
+_sendto_channel_local_with_capability_butone(struct Client *one, int type, int caps, int negcaps, struct Channel *chptr,
+       const char *pattern, va_list * args)
 {
-       va_list args;
        buf_head_t linebuf;
        struct membership *msptr;
        struct Client *target_p;
        rb_dlink_node *ptr;
        rb_dlink_node *next_ptr;
        
-       rb_linebuf_newbuf(&linebuf); 
+       rb_linebuf_newbuf(&linebuf);
+       rb_linebuf_putmsg(&linebuf, pattern, args, NULL);
        
-       va_start(args, pattern);
-       rb_linebuf_putmsg(&linebuf, pattern, &args, NULL);
-       va_end(args);
-
        RB_DLINK_FOREACH_SAFE(ptr, next_ptr, chptr->locmembers.head)
        {
                msptr = ptr->data;
                target_p = msptr->client_p;
 
+               if (target_p == one)
+                       continue;
+
                if(IsIOError(target_p) ||
                   !IsCapable(target_p, caps) ||
                   !NotCapable(target_p, negcaps))
@@ -809,6 +808,41 @@ sendto_channel_local_with_capability(int type, int caps, int negcaps, struct Cha
        rb_linebuf_donebuf(&linebuf);
 }
 
+/* sendto_channel_local_with_capability()
+ *
+ * inputs      - flags to send to, caps, negate caps, channel to send to, va_args
+ * outputs     - message to local channel members
+ * side effects -
+ */
+void
+sendto_channel_local_with_capability(int type, int caps, int negcaps, struct Channel *chptr, const char *pattern, ...)
+{
+       va_list args;
+
+       va_start(args, pattern);
+       _sendto_channel_local_with_capability_butone(NULL, type, caps, negcaps, chptr, pattern, &args);
+       va_end(args);
+}
+
+
+/* sendto_channel_local_with_capability()
+ *
+ * inputs      - flags to send to, caps, negate caps, channel to send to, va_args
+ * outputs     - message to local channel members
+ * side effects -
+ */
+void
+sendto_channel_local_with_capability_butone(struct Client *one, int type, int caps, int negcaps, struct Channel *chptr,
+               const char *pattern, ...)
+{
+       va_list args;
+
+       va_start(args, pattern);
+       _sendto_channel_local_with_capability_butone(one, type, caps, negcaps, chptr, pattern, &args);
+       va_end(args);
+}
+
+
 /* sendto_channel_local_butone()
  *
  * inputs      - flags to send to, channel to send to, va_args