Fix deaf/mute issues. Fix channel moves by admin and admin enter channels with password.
[umurmur.git] / src / client.h
index a74a2068580d74b7ad04f39591c3e9e53fec860a..853a076d6252189dfd859e621c3433f97ce091ed 100644 (file)
@@ -1,5 +1,5 @@
-/* Copyright (C) 2009-2010, Martin Johansson <martin@fatbob.nu>
-   Copyright (C) 2005-2010, Thorvald Natvig <thorvald@natvig.com>
+/* Copyright (C) 2009-2012, Martin Johansson <martin@fatbob.nu>
+   Copyright (C) 2005-2012, Thorvald Natvig <thorvald@natvig.com>
 
    All rights reserved.
 
@@ -31,6 +31,7 @@
 #ifndef CLIENT_H_45786678
 #define CLIENT_H_45786678
 
+#include <config.h>
 #include <stdint.h>
 #include <unistd.h>             /* close() */
 #include <sys/types.h>
@@ -52,6 +53,8 @@
 #define UDP_BUFSIZE 512
 #define INACTICITY_TIMEOUT 15 /* Seconds */
 #define MAX_CODECS 10
+#define MAX_TOKENSIZE 64
+#define MAX_TOKENS 32
 
 #define IS_AUTH(_a_) ((_a_)->authenticated)
 
@@ -70,7 +73,7 @@ typedef struct {
        int sessionId;
        uint64_t key;
        char *username;
-       bool_t bUDP, authenticated, deaf, mute, recording;
+       bool_t bUDP, authenticated, deaf, mute, self_deaf, self_mute, recording;
        char *os, *release, *os_version;
        uint32_t version;
        int codec_count;
@@ -84,6 +87,10 @@ typedef struct {
        char *context;
        struct dlist chan_node;
        struct dlist voicetargets;
+       struct dlist tokens;
+       int tokencount;
+       uint8_t hash[20];
+       bool_t isAdmin;
        float UDPPingAvg, UDPPingVar, TCPPingAvg, TCPPingVar;
        uint32_t UDPPackets, TCPPackets;
 } client_t;
@@ -93,6 +100,11 @@ typedef struct {
        struct dlist node;
 } codec_t;
 
+typedef struct {
+       char *token;
+       struct dlist node;
+} token_t;
+
 void Client_init();
 int Client_getfds(struct pollfd *pollfds);
 void Client_janitor();