summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2012-02-13 09:25:15 +0100
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2012-02-13 09:25:15 +0100
commit3266ae9f23cc4dff4190eb9b287a137f0ec8a10b (patch)
tree77f7dcd00440a0f40d80ff31d6f98113a92a3f33 /src
parentb30b0e8cff7a3b4a0bb1199ea1a398d75d05b105 (diff)
downloadcmumble-3266ae9f23cc4dff4190eb9b287a137f0ec8a10b.tar.gz
cmumble-3266ae9f23cc4dff4190eb9b287a137f0ec8a10b.tar.bz2
cmumble-3266ae9f23cc4dff4190eb9b287a137f0ec8a10b.zip
Implement reject message
Diffstat (limited to 'src')
-rw-r--r--src/cmumble.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/cmumble.c b/src/cmumble.c
index 9e3d931..f37d782 100644
--- a/src/cmumble.c
+++ b/src/cmumble.c
@@ -199,6 +199,26 @@ recv_text_message(MumbleProto__TextMessage *text, struct cmumble *cm)
g_print("%s> %s\n", user->name, text->message);
}
+static void
+recv_reject(MumbleProto__Reject *reject, struct cmumble *cm)
+{
+ switch (reject->type) {
+ case MUMBLE_PROTO__REJECT__REJECT_TYPE__None:
+ case MUMBLE_PROTO__REJECT__REJECT_TYPE__WrongVersion:
+ case MUMBLE_PROTO__REJECT__REJECT_TYPE__InvalidUsername:
+ case MUMBLE_PROTO__REJECT__REJECT_TYPE__WrongUserPW:
+ case MUMBLE_PROTO__REJECT__REJECT_TYPE__WrongServerPW:
+ case MUMBLE_PROTO__REJECT__REJECT_TYPE__UsernameInUse:
+ case MUMBLE_PROTO__REJECT__REJECT_TYPE__ServerFull:
+ case MUMBLE_PROTO__REJECT__REJECT_TYPE__NoCertificate:
+ g_printerr("Connection rejected: %s\n", reject->reason);
+ break;
+ default:
+ break;
+ }
+ g_main_loop_quit(cm->loop);
+}
+
static const struct {
#define MUMBLE_MSG(a,b) void (* a)(MumbleProto__##a *, \
struct cmumble *);
@@ -209,7 +229,7 @@ static const struct {
.UDPTunnel = recv_udp_tunnel,
.Authenticate = NULL,
.Ping = NULL,
- .Reject = NULL,
+ .Reject = recv_reject,
.ServerSync = recv_server_sync,
.ChannelRemove = NULL,
.ChannelState = recv_channel_state,