Package com.calclab.emite.im.client.chat.pair

Examples of com.calclab.emite.im.client.chat.pair.PairChat


    chatManager.addPairChatChangedHandler(this);
  }
 
  @Override
  public void onPairChatChanged(final PairChatChangedEvent event) {
    final PairChat chat = event.getChat();
    display.print("CHAT CHANGED " + chat.getURI() + " - " + event.getChangeType(), Style.event);
   
    if (event.is(ChangeType.created)) {
      chat.addChatStateChangedHandler(false, new ChatStateChangedEvent.Handler() {
        @Override
        public void onChatStateChanged(final ChatStateChangedEvent event) {
          display.print("CHAT STATE " + chat.getURI() + " changed: " + event.getState(), Style.event);
        }
      });
     
      display.print("CHAT STATE " + chat.getURI() + " - " + chat.getChatState(), Style.event);
      chat.addErrorHandler(new ErrorEvent.Handler() {
        @Override
        public void onError(final ErrorEvent event) {
          final String stanza = event.getStanza() != null ? event.getStanza().toString() : "(no stanza)";
          display.print("CHAT ERROR " + chat.getURI() + ": " + event.getErrorType() + "- " + event.getDescription() + ": " + stanza, Style.error);
        }
      });
    }
  }
View Full Code Here

TOP

Related Classes of com.calclab.emite.im.client.chat.pair.PairChat

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.