summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2012-02-13 09:25:15 +0100
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2013-11-18 13:22:05 +0100
commitb917bc69384a2e636a717a8730ad5105f7b2bf1a (patch)
tree2b3f25bb280f444245dc783c26b77a807beba8bb
parentacd6eea934442be4514e2176b49d5d6e3d5eb6d8 (diff)
downloadcmumble-b917bc69384a2e636a717a8730ad5105f7b2bf1a.tar.gz
cmumble-b917bc69384a2e636a717a8730ad5105f7b2bf1a.tar.bz2
cmumble-b917bc69384a2e636a717a8730ad5105f7b2bf1a.zip
Implement reject message
-rw-r--r--src/cmumble.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/cmumble.c b/src/cmumble.c
index 4dc0de8..350db56 100644
--- a/src/cmumble.c
+++ b/src/cmumble.c
@@ -184,6 +184,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 *);
@@ -194,7 +214,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,