X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=src%2Fvoicetarget.c;h=e2ed569c8f2db196c6d129404503a93355848e7d;hb=97729daab63f49323ca6bee7859260653e5090a1;hp=935139fd2fb8c7080e9773771bb5be5a3e46af8f;hpb=46d18f60766f997d0ca37c5937f58c0c06477932;p=umurmur.git diff --git a/src/voicetarget.c b/src/voicetarget.c index 935139f..e2ed569 100644 --- a/src/voicetarget.c +++ b/src/voicetarget.c @@ -1,5 +1,5 @@ -/* Copyright (C) 2009-2010, Martin Johansson - Copyright (C) 2005-2010, Thorvald Natvig +/* Copyright (C) 2009-2014, Martin Johansson + Copyright (C) 2005-2014, Thorvald Natvig All rights reserved. @@ -29,6 +29,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include +#include #include "voicetarget.h" #include "log.h" @@ -36,7 +38,7 @@ void Voicetarget_add_session(client_t *client, int targetId, int sessionId) { struct dlist *itr; voicetarget_t *vt; - + list_iterate(itr, &client->voicetargets) { if (targetId == list_get_entry(itr, voicetarget_t, node)->id) { int i; @@ -52,38 +54,41 @@ void Voicetarget_add_session(client_t *client, int targetId, int sessionId) } } -void Voicetarget_add_channel(client_t *client, int targetId, int channelId) +void Voicetarget_add_channel(client_t *client, int targetId, int channelId, + bool_t linked, bool_t children) { struct dlist *itr; voicetarget_t *vt; - + list_iterate(itr, &client->voicetargets) { if (targetId == list_get_entry(itr, voicetarget_t, node)->id) { int i; vt = list_get_entry(itr, voicetarget_t, node); for (i = 0; i < TARGET_MAX_CHANNELS; i++) { - if (vt->channels[i] == -1) { - vt->channels[i] = channelId; + if (vt->channels[i].channel == -1) { + vt->channels[i].channel = channelId; + vt->channels[i].linked = linked; + vt->channels[i].children = children; Log_debug("Adding channel ID %d to voicetarget ID %d", channelId, targetId); return; } } } - } + } } void Voicetarget_add_id(client_t *client, int targetId) { voicetarget_t *newtarget; int i; - + Voicetarget_del_id(client, targetId); newtarget = malloc(sizeof(voicetarget_t)); if (!newtarget) Log_fatal("Out of memory"); memset(newtarget, 0, sizeof(voicetarget_t)); for (i = 0; i < TARGET_MAX_CHANNELS; i++) - newtarget->channels[i] = -1; + newtarget->channels[i].channel = -1; for (i = 0; i < TARGET_MAX_SESSIONS; i++) newtarget->sessions[i] = -1; newtarget->id = targetId;