]> jfr.im git - irc/evilnet/x3.git/blobdiff - src/proto-p10.c
Fixed a couple of bugs in BURST message formatting
[irc/evilnet/x3.git] / src / proto-p10.c
index 347a5d214118aa0abedabf3da68af50fb57a7a1f..27745009956fd7bad20d0b6aec537d422ad36858 100644 (file)
@@ -909,6 +909,10 @@ irc_burst(struct chanNode *chan)
         if ((n+1)<chan->members.used)
             burst_line[pos++] = ',';
     }
+
+    if (len > 0 && (chan->banlist.used > 0 || chan->exemptlist.used > 0))
+        burst_line[pos++] = ' ';
+
     if (chan->banlist.used) {
         /* dump the bans */
         first_ban = 1;
@@ -934,13 +938,18 @@ irc_burst(struct chanNode *chan)
             }
         }
     }
+
     if (chan->exemptlist.used) {
         /* dump the exempts */
         first_exempt = 1;
 
         for (n=0; n<chan->exemptlist.used; ) {
             if (first_exempt && (pos < 500)) {
-                burst_line[pos++] = ' ';
+                if (chan->banlist.used < 1) {
+                    burst_line[pos++] = ':';
+                    burst_line[pos++] = '%';
+                    burst_line[pos++] = ' ';
+                }
                 burst_line[pos++] = '~';
                 burst_line[pos++] = ' ';
             }
@@ -1131,9 +1140,9 @@ irc_topic(struct userNode *service, struct userNode *who, struct chanNode *what,
               safestrncpy(sident, who->ident, sizeof(shost));
 
           safestrncpy(shost, host, sizeof(shost));
-      } else if (IsHiddenHost(who) && (hhtype == 1) && who->handle_info && hhstr) {
+      } else if (IsHiddenHost(who) && ((hhtype == 1) || (hhtype == 3)) && who->handle_info && hhstr) {
           snprintf(shost, sizeof(shost), "%s.%s", who->handle_info->handle, hhstr);
-      } else if (IsHiddenHost(who) && (hhtype == 2) && who->crypthost[0]) {
+      } else if (IsHiddenHost(who) && ((hhtype == 2) || (hhtype == 3)) && who->crypthost[0]) {
           safestrncpy(shost, who->crypthost, sizeof(shost));
       } else
           safestrncpy(shost, who->hostname, sizeof(shost));
@@ -1222,7 +1231,7 @@ void irc_sno(unsigned int mask, char const* format, ...) {
 void
 irc_sasl(struct server* dest, const char *identifier, const char *subcmd, const char *data)
 {
-    putsock("%s " P10_SASL " %s %s %s :%s", self->numeric, dest->numeric, identifier, subcmd, data);
+    putsock("%s " P10_SASL " %s %s %s %s", self->numeric, dest->numeric, identifier, subcmd, data);
 }
 
 static void send_burst(void);