Examples of FindBuddySuccessEvent


Examples of net.solosky.maplefetion.event.action.success.FindBuddySuccessEvent

      //当找到好友操作完成之后,判断是否找到,如果找到就发送消息
      ActionEventListener tmpListener = new ActionEventListener() {
        public void fireEevent(ActionEvent event){
          if(event.getEventType()==ActionEventType.SUCCESS){
            //成功的找到了好友,获取这个好友,然后发送消息
            FindBuddySuccessEvent evt = (FindBuddySuccessEvent) event;
            sendChatMessage(evt.getFoundBuddy(), message, listener);
          }else{
            //查找失败直接回调设置的方法
            listener.fireEevent(event);
          }
        }
View Full Code Here

Examples of net.solosky.maplefetion.event.action.success.FindBuddySuccessEvent

   
    //注释同上一个方法,这里不赘述了
    ActionEventListener tmpListener = new ActionEventListener() {
      public void fireEevent(ActionEvent event){
        if(event.getEventType()==ActionEventType.SUCCESS){
          FindBuddySuccessEvent evt = (FindBuddySuccessEvent) event;
          sendSMSMessage(evt.getFoundBuddy(), message, listener);
        }else{
          listener.fireEevent(event);
        }
      }
    };
View Full Code Here

Examples of net.solosky.maplefetion.event.action.success.FindBuddySuccessEvent

    Iterator<Buddy> it = this.getFetionStore().getBuddyList().iterator();
    while(it.hasNext()){
      Buddy buddy = it.next();
      if(buddy.getMobile()==mobile){  //找到了好友,直接通知监听器
        if(listener!=null){
          listener.fireEevent(new FindBuddySuccessEvent(buddy));
          return;
        }
      }
    }
   
View Full Code Here

Examples of net.solosky.maplefetion.event.action.success.FindBuddySuccessEvent

    Element personal = XMLHelper.find(root, "/results/contact");
    if(personal!=null) {
      int userId = Integer.parseInt(personal.getAttributeValue("user-id"));
      Buddy buddy = this.context.getFetionStore().getBuddyByUserId(userId);
      if(buddy!=null) {
        return new FindBuddySuccessEvent(buddy);        //找到该用户并且是好友,操作正确完成
      }else {
        return new FailureEvent(FailureType.BUDDY_NOT_FOUND)//找到该用户但不是好友
      }
    }else{
      return new FailureEvent(FailureType.SIPC_FAIL);        //服务器没有返回数据
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.