Package net.solosky.maplefetion.client.dialog

Examples of net.solosky.maplefetion.client.dialog.ChatDialogProxy


  public void handle(SipcNotify notify) throws FetionException {
    Element root = XMLHelper.build(notify.getBody().toSendString());
    Element node = XMLHelper.find(root, "/is-composing/state");
    String  state = node.getText();
    Buddy   from  = context.getFetionStore().getBuddyByUri(notify.getFrom());
    ChatDialogProxy chatDialogProxy = this.context.getChatDialogProxyFactoy().create(from);
    if("nudge".equals(state)){
      this.tryFireNotifyEvent(new ChatNudgeEvent(chatDialogProxy));
    }else if("input".equals(state)){
      this.tryFireNotifyEvent(new ChatInputEvent(chatDialogProxy));
    }else{
View Full Code Here


        request.setResponseHandler(new GetContactInfoResponseHandler(context, dialog, from ,null));
        this.dialog.process(request);
      }
    
      //查找这个好友的聊天代理对话
      ChatDialogProxy chatDialogProxy = this.context.getChatDialogProxyFactoy().create(from);
     
      //通知消息监听器
      if(chatDialogProxy!=null && this.context.getNotifyEventListener()!=null) {
        this.tryFireNotifyEvent(new BuddyMessageEvent(from, chatDialogProxy, msg));
      }
View Full Code Here

    @Override
    public void sendSMS(String uri, final String msg)
    {
      try{
          Buddy buddy = this.client.getFetionStore().getBuddyByUri(uri);
          ChatDialogProxy dialog = this.client.getChatDialogProxyFactory().create(buddy);
        dialog.sendChatMessage(new Message(msg), new DefaultActionListener("发送消息[ "+msg+" ]给"+buddy.getDisplayName()));
        } catch (FetionException e) {
          println("建立对话框时出错"+e.getMessage());
        }
    }
View Full Code Here

      }
    };
    this.context.getFetionExecutor().submitTask(r);
   
    //通知监听器收到了一个邀请
    ChatDialogProxy cd = this.context.getChatDialogProxyFactoy().create(buddy);
    this.tryFireNotifyEvent(new InviteReceivedEvent(cd));
    }
View Full Code Here

       * @param dialog
       * @param message
       */
      private void send(final Buddy buddy,final String message)
      {
        ChatDialogProxy proxy = null;
            try {
              proxy = this.client.getChatDialogProxyFactory().create(buddy);
            } catch (DialogException e) {
            println("建立对话失败!!");
            return;
            }
        proxy.sendChatMessage( Message.wrap(message), new ActionEventListener(){
        public void fireEevent(ActionEvent event)
         {
           if(event.getEventType()==ActionEventType.SUCCESS){
            SendChatMessageSuccessEvent evt = (SendChatMessageSuccessEvent) event;
            if(evt.isSendToMobile()){
View Full Code Here

     
      /**
       * 发送震屏
       */
      public void nudge(String uri){
        ChatDialogProxy proxy = null;
        Buddy buddy = client.getFetionStore().getBuddyByUri(uri);
        int state = buddy.getPresence().getValue();
        if(state==Presence.OFFLINE){
          println("你不能给不在线的好友发送震屏。");
          prompt();
          return;
        }
       
            try {
              proxy = this.client.getChatDialogProxyFactory().create(buddy);
              if(proxy.getState()==DialogState.CREATED){
                proxy.openDialog();
              }
            } catch (Exception e) {
            println("建立对话失败!!");
            return;
      }
           
            proxy.sendNudgeState(new ActionEventListener() {
        @Override
        public void fireEevent(ActionEvent event) {
          if(event.getEventType()==ActionEventType.SUCCESS){
            println("发送震屏成功。");
          }else{
View Full Code Here

      relation==Relation.DECLINED||
      relation==Relation.UNCONFIRMED) {
      if(listener!=null) listener.fireEevent(new FailureEvent(FailureType.BUDDY_RELATION_FORBIDDEN));
    }else {
        try {
          ChatDialogProxy proxy = this.proxyFactory.create(toBuddy);
          proxy.sendChatMessage(message, listener);
        } catch (DialogException e) {
          listener.fireEevent(new SystemErrorEvent(e));
        }
    }
  }
View Full Code Here

TOP

Related Classes of net.solosky.maplefetion.client.dialog.ChatDialogProxy

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.