summaryrefslogtreecommitdiff
path: root/src/irc
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-01-14 18:16:39 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-01-14 18:16:39 +0000
commit93ba91b8ed23284cfe14f5d77d5910e112039424 (patch)
treea9df37804b004b063156f4c646162cb2fda51f78 /src/irc
parentd427f741432742e2aba05ac610421c7661ea4a30 (diff)
downloadirssi-93ba91b8ed23284cfe14f5d77d5910e112039424.zip
Added my_asctime()
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1114 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/irc')
-rw-r--r--src/irc/core/ctcp.c9
-rw-r--r--src/irc/core/irc-nicklist.c22
2 files changed, 3 insertions, 28 deletions
diff --git a/src/irc/core/ctcp.c b/src/irc/core/ctcp.c
index 3d904dd0..b9efbdb3 100644
--- a/src/irc/core/ctcp.c
+++ b/src/irc/core/ctcp.c
@@ -21,6 +21,7 @@
#include "module.h"
#include "signals.h"
#include "levels.h"
+#include "misc.h"
#include "special-vars.h"
#include "settings.h"
@@ -99,17 +100,11 @@ static void ctcp_time(IRC_SERVER_REC *server, const char *data,
const char *nick)
{
char *str, *reply;
- struct tm *tm;
- time_t t;
g_return_if_fail(server != NULL);
g_return_if_fail(nick != NULL);
- t = time(NULL);
- tm = localtime(&t);
- reply = g_strdup(asctime(tm));
- if (reply[strlen(reply)-1] == '\n') reply[strlen(reply)-1] = '\0';
-
+ reply = my_asctime(time(NULL));
str = g_strdup_printf("NOTICE %s :\001TIME %s\001", nick, reply);
ctcp_send_reply(server, str);
g_free(str);
diff --git a/src/irc/core/irc-nicklist.c b/src/irc/core/irc-nicklist.c
index 391399bf..245d1fdd 100644
--- a/src/irc/core/irc-nicklist.c
+++ b/src/irc/core/irc-nicklist.c
@@ -268,9 +268,6 @@ static void event_target_unavailable(IRC_SERVER_REC *server, const char *data)
static void event_nick(SERVER_REC *server, const char *data,
const char *orignick)
{
- IRC_CHANNEL_REC *channel;
- NICK_REC *nickrec;
- GSList *nicks, *tmp;
char *params, *nick;
g_return_if_fail(data != NULL);
@@ -286,24 +283,7 @@ static void event_nick(SERVER_REC *server, const char *data,
signal_emit("server nick changed", 1, server);
}
- nicks = nicklist_get_same(server, orignick);
- for (tmp = nicks; tmp != NULL; tmp = tmp->next->next) {
- channel = tmp->data;
- nickrec = tmp->next->data;
-
- /* remove old nick from hash table */
- g_hash_table_remove(channel->nicks, nickrec->nick);
-
- g_free(nickrec->nick);
- nickrec->nick = g_strdup(nick);
-
- /* add new nick to hash table */
- g_hash_table_insert(channel->nicks, nickrec->nick, nickrec);
-
- signal_emit("nicklist changed", 3, channel, nickrec, orignick);
- }
- g_slist_free(nicks);
-
+ nicklist_rename(server, orignick, nick);
g_free(params);
}