Search in sources :

Example 1 with DefaultExtensionElement

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);
}
Also used : Message(org.jivesoftware.smack.packet.Message) DefaultExtensionElement(org.jivesoftware.smack.packet.DefaultExtensionElement)

Aggregations

DefaultExtensionElement (org.jivesoftware.smack.packet.DefaultExtensionElement)1 Message (org.jivesoftware.smack.packet.Message)1