diff options
author | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2011-09-24 12:54:31 +0200 |
---|---|---|
committer | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2011-09-24 12:59:42 +0200 |
commit | c820c3d4830b2c5db1c026ee332f2d773c366247 (patch) | |
tree | 993f5622d79236cdec2b86aa05f115ea2875c057 /src/cmumble.c | |
parent | 99961ccd710e5300de5fb749aa10619632ac96e9 (diff) | |
download | cmumble-c820c3d4830b2c5db1c026ee332f2d773c366247.tar.gz cmumble-c820c3d4830b2c5db1c026ee332f2d773c366247.tar.bz2 cmumble-c820c3d4830b2c5db1c026ee332f2d773c366247.zip |
Add a general element finding routine to util.c
And use this to implement find_user and find_channel
as inline functions.
Diffstat (limited to 'src/cmumble.c')
-rw-r--r-- | src/cmumble.c | 33 |
1 files changed, 2 insertions, 31 deletions
diff --git a/src/cmumble.c b/src/cmumble.c index cc2d22d..3599f91 100644 --- a/src/cmumble.c +++ b/src/cmumble.c @@ -6,36 +6,7 @@ #include "cmumble.h" #include "io.h" #include "connection.h" - -static struct cmumble_user * -find_user(struct cmumble_context *ctx, uint32_t session) -{ - struct cmumble_user *user = NULL; - GList *l; - - for (l = ctx->users; l; l = l->next) - if (((struct cmumble_user *) l->data)->session == session) { - user = l->data; - break; - } - - return user; -} - -static struct cmumble_channel * -find_channel(struct cmumble_context *ctx, uint32_t id) -{ - struct cmumble_channel *channel = NULL; - GList *l; - - for (l = ctx->channels; l; l = l->next) - if (((struct cmumble_channel *) l->data)->id == id) { - channel = l->data; - break; - } - - return channel; -} +#include "util.h" static void recv_udp_tunnel(MumbleProto__UDPTunnel *tunnel, struct cmumble_context *ctx) @@ -185,7 +156,7 @@ recv_user_state(MumbleProto__UserState *state, struct cmumble_context *ctx) user->session = state->session; user->name = g_strdup(state->name); - user->user_id = state->user_id; + user->id = state->user_id; cmumble_audio_create_playback_pipeline(ctx, user); |