Package net.solosky.maplefetion.client.dialog

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


                  BeanHelper.toBean(Presence.class, buddy.getPresence(), presence);
                  if(oldpresense!=curpresense) {
                    //注意,如果好友上线了,并且当前打开了手机聊天对话框,需要关闭这个手机聊天对话框
                    if(curpresense == Presence.AWAY   || curpresense == Presence.BUSY ||
                       curpresense == Presence.ONLINE || curpresense == Presence.ROBOT ) {
                      ChatDialog chatDialog = this.context.getDialogFactory().findChatDialog(buddy);
                      if(chatDialog!=null && chatDialog instanceof BasicChatDialog) {
                        chatDialog.closeDialog();
                      }
                    }
                   
                    //通知监听器,好友状态已经改变
                    this.tryFireNotifyEvent(new BuddyPresenceEvent(buddy));
View Full Code Here


    public void handle(SipcNotify notify) throws FetionException
    {
      Buddy buddy = this.context.getFetionStore().getBuddyByUri(notify.getFrom());
      boolean isCorrect = false;
      if(buddy!=null) {
          ChatDialog dialog = this.context.getDialogFactory().findChatDialog(buddy);
          if(dialog!=null && dialog.getState()==DialogState.OPENNING && dialog instanceof LiveV1ChatDialog) {
          LiveV1ChatDialog cd = (LiveV1ChatDialog) dialog;
          cd.dialogOpened();
          isCorrect = true;
          }
      }
View Full Code Here

    @Override
    public void handle(SipcNotify notify) throws FetionException
    {
      Buddy buddy = this.context.getFetionStore().getBuddyByUri(notify.getFrom());
      if(buddy!=null) {
        ChatDialog dialog = this.context.getDialogFactory().findChatDialog(buddy);
        if(dialog!=null && dialog.getState()!=DialogState.CLOSED) {
          dialog.closeDialog();
        }
      }
    }
View Full Code Here

        store.addBuddy(buddy);
      }
    }
   
    //检查之前的会话中,是否有BasicChatDialog 如果有,关闭
    ChatDialog basicDialog = context.getDialogFactory().findChatDialog(buddy);
    if(basicDialog instanceof BasicChatDialog){
      basicDialog.closeDialog()//关闭并从当前对话列表中移除
    }
   
    //和邀请的好友建立会话
      final ChatDialog dialog = context.getDialogFactory().createChatDialog(notify);
      Runnable r = new Runnable(){
      public void run(){
          //在另外一个线程里打开这个对话框
        try {
                  dialog.openDialog();
                  logger.debug("Created and opened ChatDialog success - Dialog="+dialog);
                } catch (FetionException e) {
                  logger.warn("create ChatDialog by invite notify failed.", e);
                  //发生错误就关闭这个对话框
                  dialog.closeDialog();
                }
      }
    };
    this.context.getFetionExecutor().submitTask(r);
   
View Full Code Here

TOP

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

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.