summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/cmumble.c4
-rw-r--r--src/cmumble.h2
2 files changed, 6 insertions, 0 deletions
diff --git a/src/cmumble.c b/src/cmumble.c
index d276c8a..bca92c3 100644
--- a/src/cmumble.c
+++ b/src/cmumble.c
@@ -88,6 +88,7 @@ static void
recv_server_sync(MumbleProto__ServerSync *sync, struct cmumble_context *ctx)
{
ctx->session = sync->session;
+ ctx->user = find_user(ctx, ctx->session);
if (sync->welcome_text)
g_print("Welcome Message: %s\n", sync->welcome_text);
@@ -165,6 +166,9 @@ recv_user_state(MumbleProto__UserState *state, struct cmumble_context *ctx)
user->id = state->user_id;
user->channel = find_channel(ctx, state->channel_id);
+ if (ctx->session == user->session)
+ ctx->user = user;
+
cmumble_audio_create_playback_pipeline(ctx, user);
g_print("receive user: %s\n", user->name);
ctx->users = g_list_prepend(ctx->users, user);
diff --git a/src/cmumble.h b/src/cmumble.h
index 5168718..cc29ef4 100644
--- a/src/cmumble.h
+++ b/src/cmumble.h
@@ -32,6 +32,8 @@ struct cmumble_context {
GList *users;
GList *channels;
+
+ struct cmumble_user *user;
};
struct cmumble_user {