mirror of
https://github.com/irssi/irssi.git
synced 2026-08-18 08:02:13 +02:00
Added my_asctime()
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1114 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
d427f74143
commit
93ba91b8ed
6 changed files with 27 additions and 60 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue