Package net.solosky.maplefetion.bean

Examples of net.solosky.maplefetion.bean.Buddy


      /**
       * 发送手机短信消息
       */
      public void sms(String uri, final String message)
      {
        final Buddy buddy = this.client.getFetionStore().getBuddyByUri(uri);
        if(buddy!=null) {
          this.client.sendSMSMessage(buddy, Message.wrap(message), new ActionEventListener(){
          public void fireEevent(ActionEvent event)
          {
            if(event.getEventType()==ActionEventType.SUCCESS){
              println("提示:发送给"+buddy.getDisplayName()+" 的短信发送成功!");
            }else{
              println("[系统消息]:你发给 "+buddy.getDisplayName()+" 的短信  "+message+" 发送失败!");
            }
          }
        });
        }else {
          println("找不到这个好友,请检查你的输入!");
View Full Code Here


      /**
       * 获取好友详细信息
       */
      public void detail(String uri)
      {
        final Buddy buddy = this.client.getFetionStore().getBuddyByUri(uri);
        if(buddy==null) {
          println("找不到好友,请重新输入好友信息");
        }else if(UriHelper.isMobile(buddy.getUri())) {
          printBuddyInfo(buddy);
        }else {
          this.client.retireBuddyInfo(buddy, new ActionEventListener() {
          public void fireEevent(ActionEvent event)
          {
View Full Code Here

       * @param uri
       * @param localName
       */
      public void localname(String uri, String localName)
      {
        final Buddy buddy = this.client.getFetionStore().getBuddyByUri(uri);
        if(buddy!=null) {
          this.client.setBuddyLocalName(buddy, localName, new ActionEventListener() {
             public void fireEevent(ActionEvent event)
           {
             if(event.getEventType()==ActionEventType.SUCCESS){
View Full Code Here

      /**
       * 设置好友分组
       */
      public void cord(String uri, String cordId)
      {
        final Buddy buddy = this.client.getFetionStore().getBuddyByUri(uri);
        Collection<Cord> cordList = new ArrayList<Cord>();
        //本来一个好友可以分到多个组的,为了简单这里只实现了修改一个分组
        int cid = -1;
            try {
              cid = Integer.parseInt(cordId);
View Full Code Here

      /**
       * 删除好友
       */
      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

      /**
       * 同意对方请求
       */
      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

       * 拒绝陌生人添加好友请求
       * @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

      /**
       * 进入对话框
       */
      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

      /**
       * 发送震屏
       */
      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

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

TOP

Related Classes of net.solosky.maplefetion.bean.Buddy

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.