Add silent channel option
[umurmur.git] / src / client.c
index a992129cb774bcd3ba4eb6803a4cc38cc8799770..f2fda4c45bd9f044f7b3cf381288f02a82188ff0 100644 (file)
@@ -1,5 +1,5 @@
-/* Copyright (C) 2009-2012, Martin Johansson <martin@fatbob.nu>
-   Copyright (C) 2005-2012, Thorvald Natvig <thorvald@natvig.com>
+/* Copyright (C) 2009-2013, Martin Johansson <martin@fatbob.nu>
+   Copyright (C) 2005-2013, Thorvald Natvig <thorvald@natvig.com>
 
    All rights reserved.
 
@@ -871,7 +871,7 @@ int Client_voiceMsg(client_t *client, uint8_t *data, int len)
        channel_t *ch = (channel_t *)client->channel;
        struct dlist *itr;
        
-       if (!client->authenticated || client->mute || client->self_mute)
+       if (!client->authenticated || client->mute || client->self_mute || ch->silent)
                goto out;
        
        packetsize = 20 + 8 + 4 + len;
@@ -882,8 +882,8 @@ int Client_voiceMsg(client_t *client, uint8_t *data, int len)
        Timer_restart(&client->idleTime);
        Timer_restart(&client->lastActivity);
        
+       counter = Pds_get_numval(pdi); /* step past session id */
        if ((type >> 5) != UDPVoiceOpus) {
-               counter = Pds_get_numval(pdi); /* step past session id */
                do {
                        counter = Pds_next8(pdi);
                        offset = Pds_skip(pdi, counter & 0x7f);