Examples of QQBuddy


Examples of iqq.im.bean.QQBuddy

            JSONArray result = json.getJSONArray("result");
            for(int i=0; i<result.length(); i++){
               JSONObject rejson = result.getJSONObject(i);
               switch(rejson.getInt("type")){
               case 0://好友
                 QQBuddy buddy = store.getBuddyByUin(rejson.getLong("uin"));
                 if(buddy != null){
                   recents.add(buddy);
                 }
               } break;
              
View Full Code Here

Examples of iqq.im.bean.QQBuddy

        JSONObject obj = result.getJSONObject(i);
        long uin = obj.getLong("uin");
        String status = obj.getString("status");
        int clientType = obj.getInt("client_type");
       
        QQBuddy buddy = store.getBuddyByUin(uin);
        buddy.setStatus(QQStatus.valueOfRaw(status));
        buddy.setClientType(QQClientType.valueOfRaw(clientType));
      }
     
    }

    notifyActionEvent(QQActionEvent.Type.EVT_OK, store.getOnlineBuddyList());
View Full Code Here

Examples of iqq.im.bean.QQBuddy

        qqc.setSort(jsonCategory.getInt("sort"));
        store.addCategory(qqc);
      }
      // 处理好友基本信息列表 flag/uin/categories
      for (int i = 0; i < jsonFriends.length(); i++) {
        QQBuddy buddy = new QQBuddy();
        JSONObject jsonFriend = jsonFriends.getJSONObject(i);
        long uin = jsonFriend.getLong("uin");
        buddy.setUin(uin);
        buddy.setStatus(QQStatus.OFFLINE);
        buddy.setClientType(QQClientType.UNKNOWN);
        // 添加到列表中
        int category = jsonFriend.getInt("categories");
        QQCategory qqCategory = store.getCategoryByIndex(category);
        buddy.setCategory(qqCategory);
        qqCategory.getBuddyList().add(buddy);

        // 记录引用
        store.addBuddy(buddy);
      }
      // face/flag/nick/uin
      for (int i = 0; i < jsonInfo.length(); i++) {
        JSONObject info = jsonInfo.getJSONObject(i);
        long uin = info.getLong("uin");
        QQBuddy buddy = store.getBuddyByUin(uin);
        buddy.setNickname(info.getString("nick"));
      }
      // uin/markname
      for (int i = 0; i < jsonMarknames.length(); i++) {
        JSONObject jsonMarkname = jsonMarknames.getJSONObject(i);
        long uin = jsonMarkname.getLong("uin");
        QQBuddy buddy = store.getBuddyByUin(uin);
        if(buddy != null){
          buddy.setMarkname(jsonMarkname.getString("markname"));
        }
      }
      // vip_level/u/is_vip
      for (int i = 0; i < jsonVipinfo.length(); i++) {
        JSONObject vipInfo = jsonVipinfo.getJSONObject(i);
        long uin = vipInfo.getLong("u");
        QQBuddy buddy = store.getBuddyByUin(uin);
        buddy.setVipLevel(vipInfo.getInt("vip_level"));
        int isVip = vipInfo.getInt("is_vip");
        if(isVip != 0) {
          buddy.setVip(true);
        } else {
          buddy.setVip(false);
        }
      }

      notifyActionEvent(QQActionEvent.Type.EVT_OK, store.getCategoryList());
View Full Code Here

Examples of iqq.im.bean.QQBuddy

          JSONObject poll = results.getJSONObject(i);
          String pollType = poll.getString("poll_type");
          JSONObject pollData = poll.getJSONObject("value");
          if (pollType.equals("input_notify")) {
            long fromUin = pollData.getLong("from_uin");
            QQBuddy buddy = store.getBuddyByUin(fromUin);
            notifyEvents.add(new QQNotifyEvent(
                QQNotifyEvent.Type.BUDDY_INPUT, buddy));
          } else if (pollType.equals("message")) {
            // 好友消息
            notifyEvents.add(processBuddyMsg(pollData));
View Full Code Here

Examples of iqq.im.bean.QQBuddy

   * @return a {@link iqq.im.event.QQNotifyEvent} object.
   */
  public QQNotifyEvent processBuddyStatusChange(JSONObject pollData)
      throws JSONException {
    long uin = pollData.getLong("uin");
    QQBuddy buddy = getContext().getStore().getBuddyByUin(uin);
    String status = pollData.getString("status");
    int clientType = pollData.getInt("client_type");
    buddy.setStatus(QQStatus.valueOfRaw(status));
    buddy.setClientType(QQClientType.valueOfRaw(clientType));
    return new QQNotifyEvent(QQNotifyEvent.Type.BUDDY_STATUS_CHANGE, buddy);
  }
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.