package com.github.theholywaffle.teamspeak3.api.event;

/*
 * #%L
 * TeamSpeak 3 Java API
 * %%
 * Copyright (C) 2014 Bert De Geyter
 * %%
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 * #L%
 */

import com.github.theholywaffle.teamspeak3.api.TextMessageTargetMode;

import java.util.Map;

public class TextMessageEvent extends BaseEvent {

	public TextMessageEvent(Map<String, String> map) {
		super(map);
	}

	public TextMessageTargetMode getTargetMode() {
		int mode = getInt("targetmode");
		for (TextMessageTargetMode m : TextMessageTargetMode.values()) {
			if (m.getIndex() == mode) {
				return m;
			}
		}
		return null;
	}

	public String getMessage() {
		return get("msg");
	}

	@Override
	public void fire(TS3Listener listener) {
		listener.onTextMessage(this);
	}
}

@@ -1711,16 +1711,538 @@
 %22);%0A%09%7D%0A%0A
+%09/**%0A%09 * Gets the client ID of the recipient of a private message.%0A%09 * %3Cul%3E%0A%09 * %3Cli%3EIf the private message was sent %3Cb%3Eto%3C/b%3E the query, the target ID will be the query's client ID%3C/li%3E%0A%09 * %3Cli%3EIf the private message was sent %3Cb%3Eby%3C/b%3E the query, the target ID will be the recipient's client ID%3C/li%3E%0A%09 * %3Cli%3EIf this is not an event for a private message, this method will return %7B@code -1%7D%3C/li%3E%0A%09 * %3C/ul%3E%0A%09 *%0A%09 * @return the client ID of the recipient%0A%09 */%0A%09public int getTargetClientId() %7B%0A%09%09return getInt(%22target%22);%0A%09%7D%0A%0A
 %09@Overri

Add getTargetClientId to TextMessageEvent