Package iqq.im.event.future

Examples of iqq.im.event.future.ProcActionFuture


   * @param listener a {@link iqq.im.QQActionListener} object.
   * @return a {@link iqq.im.event.QQActionFuture} object.
   */
  public QQActionFuture sendMsg(final QQMsg msg, QQActionListener listener) {
    if(msg.getType() == QQMsg.Type.SESSION_MSG) {
      final ProcActionFuture future = new ProcActionFuture(listener, true);
      QQStranger stranger = (QQStranger) msg.getTo();
      if(stranger.getGroupSig() == null || stranger.getGroupSig().equals("")) {
        getSessionMsgSig(stranger, new QQActionListener() {
          @Override
          public void onActionEvent(QQActionEvent event) {
            if(event.getType() == QQActionEvent.Type.EVT_OK) {
              if(!future.isCanceled()){
                doSendMsg(msg, future);
              }
            }else if(event.getType() == QQActionEvent.Type.EVT_ERROR){
              future.notifyActionEvent(event.getType(), event.getTarget());
            }
          }
        });
      }
      return future;
    } else if(msg.getType() == QQMsg.Type.GROUP_MSG || msg.getType() == QQMsg.Type.DISCUZ_MSG) {
      if(getContext().getSession().getCfaceKey() == null || getContext().getSession().getCfaceKey().equals("")) {
        final ProcActionFuture future = new ProcActionFuture(listener, true);
        getCFaceSig(new QQActionListener() {
         
          @Override
          public void onActionEvent(QQActionEvent event) {
            if(event.getType() == QQActionEvent.Type.EVT_OK) {
              if(!future.isCanceled()){
                doSendMsg(msg, future);
              }
            }else if(event.getType() == QQActionEvent.Type.EVT_ERROR){
              future.notifyActionEvent(event.getType(), event.getTarget());
            }
          }
        });
        return future;
      }
View Full Code Here


   *
   * @param listener a {@link iqq.im.QQActionListener} object.
   * @return a {@link iqq.im.event.QQActionFuture} object.
   */
  public QQActionFuture login(QQActionListener listener) {
    ProcActionFuture future = new ProcActionFuture(listener, true);
    doGetLoginSig(future);
    return future;
  }
View Full Code Here

TOP

Related Classes of iqq.im.event.future.ProcActionFuture

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.