summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bf7dc3e)
raw | patch | inline | side by side (parent: bf7dc3e)
author | Jonathan Neuschäfer <j.neuschaefer@gmx.net> | |
Wed, 23 May 2012 00:51:24 +0000 (02:51 +0200) | ||
committer | Jonathan Neuschäfer <j.neuschaefer@gmx.net> | |
Wed, 23 May 2012 02:02:58 +0000 (04:02 +0200) |
src/screen_chat.c | patch | blob | history |
diff --git a/src/screen_chat.c b/src/screen_chat.c
index b4d3aaca89844e97aa36d6dd4513577657a8e313..6daca65aecd25f31fc3788b887f08b04e39c9f8c 100644 (file)
--- a/src/screen_chat.c
+++ b/src/screen_chat.c
#include "mpdclient.h"
#include "i18n.h"
#include "charset.h"
+#include "options.h"
#include <glib.h>
#include <mpd/idle.h>
}
}
+static char *
+screen_chat_get_prefix(void)
+{
+ static char *prefix = NULL;
+
+ if (prefix)
+ return prefix;
+
+ prefix = g_strconcat("<", g_get_user_name(), "> ", NULL);
+ return prefix;
+}
+
static void
screen_chat_send_message(struct mpdclient *c, char *msg)
{
char *utf8 = locale_to_utf8(msg);
-
- (void) mpdclient_cmd_send_message(c, chat_channel, utf8);
+ char *prefix = screen_chat_get_prefix();
+ char *full_msg = g_strconcat(prefix, utf8, NULL);
g_free(utf8);
+
+ (void) mpdclient_cmd_send_message(c, chat_channel, full_msg);
+ g_free(full_msg);
}
static bool