use of org.jivesoftware.smack.packet.DefaultExtensionElement in project Spark by igniterealtime.
the class ReversiPanel method sendForfeit.
/**
* Sends a forfeit message to the other player.
*/
public void sendForfeit() throws SmackException.NotConnectedException {
DefaultExtensionElement forfeit = new DefaultExtensionElement(GameForfeit.ELEMENT_NAME, GameForfeit.NAMESPACE);
forfeit.setValue("gameID", Integer.toString(gameID));
Message message = new Message();
message.setTo(opponentJID);
message.addExtension(forfeit);
connection.sendStanza(message);
connection.removeAsyncStanzaListener(gameMoveListener);
}
Aggregations