]> jfr.im git - irc/evilnet/x3.git/commitdiff
Bug fix for SF Bug #2547157 (topic ident bug).
authorsirvulcan <redacted>
Fri, 30 Jan 2009 04:26:08 +0000 (04:26 +0000)
committersirvulcan <redacted>
Fri, 30 Jan 2009 04:26:08 +0000 (04:26 +0000)
ChangeLog
src/opserv.c
src/proto-p10.c

index 7528544e9a963aafd3e02ccc44c6cc06e180f9c7..fa85b5c388cb087248eb7c0e8725a14e5eb8182e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,12 @@
 /***********************************************************************
 X3 ChangeLog
 
+2009-01-30  Neil Spierling  <sirvulcan@sirvulcan.co.nz>
+
+       * src/opserv.c: Warning fix.
+
+       * src/proto-p10.c: Bug fix for SF Bug #2547157 (topic ident bug).
+
 2009-01-29  Alex Schumann  <rubin@afternet.org>
 
        * src/hash.c: Added a function to check if a user pointer
index ae7c607258513b8993d3cbd5032a901d29aa40ef..a15e66e082bc2984ed7f89f2b4959794c20089ee 100644 (file)
@@ -2667,7 +2667,7 @@ opserv_new_user_check(struct userNode *user)
     char addr[IRC_NTOP_MAX_SIZE];
 
     if(!IsUserP(user))
-        return; /* bail if this user ptr doesnt still exist in users */
+        return 0; /* bail if this user ptr doesnt still exist in users */
 
     /* Check to see if we should ignore them entirely. */
     if (IsLocal(user) || IsService(user))
index b9fdac61f49e8d19e1a4aa05a2c933e4cb846af2..a09936acb186be540988997798dcec7c4556800f 100644 (file)
@@ -1091,8 +1091,7 @@ void
 irc_topic(struct userNode *service, struct userNode *who, struct chanNode *what, const char *topic)
 {
 
-   int type = 4;
-   int host_in_topic = 0;
+   int type = 4, host_in_topic = 0, hasident = 0;
    const char *hstr, *tstr;
    char *host, *hostmask;
    char shost[MAXLEN];
@@ -1110,12 +1109,17 @@ irc_topic(struct userNode *service, struct userNode *who, struct chanNode *what,
           safestrncpy(shost, who->fakehost, sizeof(shost));
       else if (IsSetHost(who)) {
           hostmask = strdup(who->sethost);
-          if ((host = (strrchr(hostmask, '@'))))
+          if ((host = (strrchr(hostmask, '@')))) {
+              hasident = 1;
               *host++ = '\0';
-          else
+          else
               host = hostmask;
 
-          safestrncpy(sident, hostmask, sizeof(shost));
+          if (hasident)
+              safestrncpy(sident, hostmask, sizeof(shost));
+          else
+              safestrncpy(sident, who->ident, sizeof(shost));
+
           safestrncpy(shost, host, sizeof(shost));
       } else
           safestrncpy(shost, who->hostname, sizeof(shost));