/***********************************************************************
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
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))
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];
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));