diff options
author | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2011-09-28 19:13:21 +0200 |
---|---|---|
committer | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2011-09-28 19:45:50 +0200 |
commit | 2aeae3f13c82d36bd1b9dae695f43ef3fea44d85 (patch) | |
tree | effdbf06e5084510b76bb19aba3fbc0c0ddb099e /src | |
parent | 2746ba8ed0032ca9361d02b98eeb0dab2e640bfe (diff) | |
download | cmumble-2aeae3f13c82d36bd1b9dae695f43ef3fea44d85.tar.gz cmumble-2aeae3f13c82d36bd1b9dae695f43ef3fea44d85.tar.bz2 cmumble-2aeae3f13c82d36bd1b9dae695f43ef3fea44d85.zip |
Support receiving TextMessages
Diffstat (limited to 'src')
-rw-r--r-- | src/cmumble.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/cmumble.c b/src/cmumble.c index bca92c3..fd444c6 100644 --- a/src/cmumble.c +++ b/src/cmumble.c @@ -174,6 +174,16 @@ recv_user_state(MumbleProto__UserState *state, struct cmumble_context *ctx) ctx->users = g_list_prepend(ctx->users, user); } +static void +recv_text_message(MumbleProto__TextMessage *text, struct cmumble_context *ctx) +{ + struct cmumble_user *user; + + user = find_user(ctx, text->actor); + if (user != NULL) + g_print("%s> %s\n", user->name, text->message); +} + static const struct { #define MUMBLE_MSG(a,b) void (* a)(MumbleProto__##a *, \ struct cmumble_context *); @@ -191,7 +201,7 @@ static const struct { .UserRemove = recv_user_remove, .UserState = recv_user_state, .BanList = NULL, - .TextMessage = NULL, + .TextMessage = recv_text_message, .PermissionDenied = NULL, .ACL = NULL, .QueryUsers = NULL, |