Examples of Buddy


Examples of net.solosky.maplefetion.bean.Buddy

      /**
       * 删除好友
       */
      public void del(String uri)
      {
        Buddy buddy = this.client.getFetionStore().getBuddyByUri(uri);
        if(buddy!=null) {
          client.deleteBuddy(buddy, new ActionEventListener() {
            public void fireEevent(ActionEvent event)
           {
             if(event.getEventType()==ActionEventType.SUCCESS){
View Full Code Here

Examples of net.solosky.maplefetion.bean.Buddy

      /**
       * 同意对方请求
       */
      public void agree(String uri)
      {
        final Buddy buddy = this.client.getFetionStore().getBuddyByUri(uri);
        if(buddy!=null) {
          this.client.agreedApplication(buddy,  new ActionEventListener() {
            public void fireEevent(ActionEvent event)
           {
             if(event.getEventType()==ActionEventType.SUCCESS){
               println("你已经同意"+buddy.getDisplayName()+"的添加你为好友的请求。");
             }else{
               println("同意对方请求失败!");
             }
           }
          });
View Full Code Here

Examples of net.solosky.maplefetion.bean.Buddy

       * 拒绝陌生人添加好友请求
       * @param uri
       */
      public void decline(String uri)
      {
        final Buddy buddy = this.client.getFetionStore().getBuddyByUri(uri);
        if(buddy!=null) {
          this.client.declinedApplication(buddy,  new ActionEventListener() {
            public void fireEevent(ActionEvent event)
           {
             if(event.getEventType()==ActionEventType.SUCCESS){
               println("你已经拒绝"+buddy.getDisplayName()+"的添加你为好友的请求。");
             }else{
               println("拒绝对方请求失败!");
             }
           }
          });
View Full Code Here

Examples of net.solosky.maplefetion.bean.Buddy

      /**
       * 进入对话框
       */
      public void enter(String uri)
      {
        Buddy buddy = this.client.getFetionStore().getBuddyByUri(uri);
        if(this.activeChatDialog==null) {
                try {
                  this.activeChatDialog = this.client.getChatDialogProxy(buddy);
                  println("提示:你现在可以和 "+ buddy.getDisplayName()+" 聊天了。");
                } catch (DialogException e) {
                println("创建对话框失败:"+e);
                }
        }else {
         
View Full Code Here

Examples of net.solosky.maplefetion.bean.Buddy

      /**
       * 发送震屏
       */
      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;
        }
View Full Code Here

Examples of net.solosky.maplefetion.bean.Buddy

   * @param uri
   * @return
   */
  public static Buddy createBuddy(String uri)
  {
    Buddy buddy = new Buddy();
    buddy.setUri(uri);
   
    return buddy;
  }
View Full Code Here

Examples of net.solosky.maplefetion.bean.Buddy

    @Override
    public synchronized Buddy getBuddyByUserId(int userId)
    {
      Iterator<Buddy> it = this.buddyList.values().iterator();
      while(it.hasNext()) {
        Buddy buddy = it.next();
        if(buddy.getUserId()==userId)
          return buddy;
      }
      return null;
    }
View Full Code Here

Examples of net.solosky.maplefetion.bean.Buddy

     */
  public synchronized Collection<Buddy> getBuddyListByCord(Cord cord)
  {
    ArrayList<Buddy> list = new ArrayList<Buddy>();
    Iterator<Buddy> it = this.buddyList.values().iterator();
    Buddy buddy = null;
    String [] buddyCordIds = null;
    while(it.hasNext()) {
      buddy = it.next();
      if(buddy.getCordId()!=null){
        buddyCordIds = buddy.getCordId().split(";");
        for(String cid : buddyCordIds){
          if(cid.equals(Integer.toString(cord.getId()))){
            list.add(buddy);
          }
        }
View Full Code Here

Examples of net.solosky.maplefetion.bean.Buddy

    @Override
    public synchronized Collection<Buddy> getBuddyListWithoutCord()
    {
      ArrayList<Buddy> list = new ArrayList<Buddy>();
    Iterator<Buddy> it = this.buddyList.values().iterator();
    Buddy buddy = null;
    String  buddyCordId = null;
    while(it.hasNext()) {
      buddy = it.next();
      buddyCordId = buddy.getCordId();
      if(buddyCordId==null || buddyCordId.length()==0) {
        list.add(buddy);
      }
    }
    return list;
View Full Code Here

Examples of net.solosky.maplefetion.bean.Buddy

    public synchronized Collection<Buddy> getBuddyListByRelation(Relation relation)
    {
      ArrayList<Buddy> list = new ArrayList<Buddy>();
      Iterator<Buddy> it = this.buddyList.values().iterator();
      while(it.hasNext()) {
        Buddy buddy = it.next();
        if(buddy.getRelation()==relation)
          list.add(buddy);
      }
      return list;
    }
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.