summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--state.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/state.c b/state.c
index b1f84ad..f51a09b 100644
--- a/state.c
+++ b/state.c
@@ -259,7 +259,16 @@ static bool originSelf(const char *origin) {
 
 static void handleNick(struct Message *msg) {
 	require(msg, true, 1);
-	if (originSelf(msg->origin)) set(&self.nick, msg->params[0]);
+	if (!originSelf(msg->origin)) return;
+	set(&self.nick, msg->params[0]);
+
+	char *rest = strchr(self.origin, '!');
+	assert(rest);
+	size_t size = strlen(self.nick) + strlen(rest) + 1;
+	char *origin = malloc(size);
+	if (!origin) err(EX_OSERR, "malloc");
+	snprintf(origin, size, "%s%s", self.nick, rest);
+	set(&self.origin, origin);
 }
 
 static void handleJoin(struct Message *msg) {
name to sshJune McEnroe 2020-09-11Add influencer tweetJune McEnroe 2020-09-10Add The Kingdom of GodsJune McEnroe 2020-09-07Add SunglassesJune McEnroe 2020-09-06Add Between the BreathsJune McEnroe 2020-09-04Open /dev/tty in nudgeJune McEnroe 2020-09-04Add nudgeJune McEnroe 2020-09-03Build fbclock with -lzJune McEnroe 2020-08-29Add tweets from retweetsJune McEnroe