On Mon, 21 Feb 2005, Kurt Stas wrote: > Hi, > > IRCu topics are like this: > -!- Topic set by Cyhiraeth [Mon Feb 14 14:42:10 2005] > > Is there any possibility to change it to: > > -!- Topic set by Cyhiraeth [EMAIL PROTECTED] [Mon Feb 14 14:42:10 > 2005] > > With a patch or will it be like this in the next version?
No idea about the next version, but if you're looking for a patch it shouldn't be much more difficult than shown below. This list is relatively dead so I guess we'll see if anyone wakes up (if for no other reason than just to flame the patch ;) The idea is to increase the size of struct channel::topic nick enough to fit the extra info and then just shove [EMAIL PROTECTED] in (instead of copying cli_name()) when the topic is changed. If the topic is set by a user. It'll bloat struct channel by some 74 bytes (depending on your config of course). And the patch below is not really that well tested; It compiles, it boots, it seems to do what it should (on a single server anyway). But of course the standard disclaimer applies. It's only meant to illustrate a point, it may eat your data. And I won't be responsible for it :) And I'm not sure clients will get it either (irssi seems to, as does mIRC). diff -ur ircu2.10.11.07/include/channel.h ircu2.10.11.07-patched/include/channel.h --- ircu2.10.11.07/include/channel.h 2003-11-01 12:19:07.000000000 +0200 +++ ircu2.10.11.07-patched/include/channel.h 2005-03-09 23:05:29.000000000 +0200 @@ -216,7 +216,7 @@ struct SLink* banlist; struct Mode mode; char topic[TOPICLEN + 1]; - char topic_nick[NICKLEN + 1]; + char topic_nick[NICKLEN + USERLEN + HOSTLEN + 3]; char chname[1]; }; diff -ur ircu2.10.11.07/ircd/m_topic.c ircu2.10.11.07-patched/ircd/m_topic.c --- ircu2.10.11.07/ircd/m_topic.c 2004-09-18 05:17:47.000000000 +0300 +++ ircu2.10.11.07-patched/ircd/m_topic.c 2005-03-09 23:06:53.000000000 +0200 @@ -115,7 +115,16 @@ newtopic=ircd_strncmp(chptr->topic,topic,TOPICLEN)!=0; /* setting a topic */ ircd_strncpy(chptr->topic, topic, TOPICLEN); - ircd_strncpy(chptr->topic_nick, cli_name(sptr), NICKLEN); + if (IsUser(sptr)) { + struct User *user = cli_user(sptr); + ircd_snprintf(sptr, chptr->topic_nick, sizeof(chptr->topic_nick), + "[EMAIL PROTECTED]", cli_name(sptr), user->username, + user->host); + } else { + ircd_strncpy(chptr->topic_nick, cli_name(sptr), + sizeof(chptr->topic_nick) - 1); + } + chptr->topic_time = CurrentTime; /* Fixed in 2.10.11: Don't propagate local topics */ if (!IsLocalChannel(chptr->chname)) -J -- Jukka Ollila <[EMAIL PROTECTED]> "Voisko joku halata mua?"