Package iqq.im.bean

Examples of iqq.im.bean.QQGroupMember


  protected QQHttpRequest onBuildRequest() throws QQException, JSONException {
    QQSession session = getContext().getSession();
    QQHttpRequest req = createHttpRequest("GET",
        QQConstants.URL_GET_SESSION_MSG_SIG);
    if(user instanceof QQGroupMember) {
      QQGroupMember mb = (QQGroupMember) user;
      mb.setServiceType(0);
      req.addGetValue("id", mb.getGroup().getGin() + "");
      req.addGetValue("service_type", "0"); // 0为群,1为讨论组
    } else if(user instanceof QQDiscuzMember) {
      QQDiscuzMember mb = (QQDiscuzMember) user;
      mb.setServiceType(1);
      req.addGetValue("id", mb.getDiscuz().getDid() + "");
      req.addGetValue("service_type", "1"); // 0为群,1为讨论组
    } else {
      LOG.info("GetSessionMsgSigAction unknow type :" + user);
    }
    req.addGetValue("to_uin", user.getUin() + "");
View Full Code Here


    if (group != null) {
      msg.setFrom(group.getMemberByUin(fromUin));
    }

    if (msg.getFrom() == null) {
      QQGroupMember member = new QQGroupMember();
      member.setUin(fromUin);
      msg.setFrom(member);
      if (group != null) {
        group.getMembers().add(member);
      }
    }
View Full Code Here

      group.setCreateTime(new Date(ginfo.getInt("createtime")));
     
      JSONArray members = ginfo.getJSONArray("members");
      for(int i=0; i<members.length(); i++){
        JSONObject memjson = members.getJSONObject(i);
        QQGroupMember member = group.getMemberByUin(memjson.getLong("muin"));
        if(member == null) {
          member = new QQGroupMember();
          group.getMembers().add(member);
        }
        member.setUin(memjson.getLong("muin"));
        member.setGroup(group);
        //memjson.getLong("mflag"); //TODO ...
      }
     
      //result/minfo
      JSONArray minfos = json.getJSONArray("minfo");
      for(int i=0; i<minfos.length(); i++){
        JSONObject minfo = minfos.getJSONObject(i);
        QQGroupMember member = group.getMemberByUin(minfo.getLong("uin"));
        member.setNickname(minfo.getString("nick"));
        member.setProvince(minfo.getString("province"));
        member.setCountry(minfo.getString("country"));
        member.setCity(minfo.getString("city"));
        member.setGender(minfo.getString("gender"));
      }
     
      //result/stats
      JSONArray stats = json.getJSONArray("stats");
      for(int i=0; i<stats.length(); i++){
        // 下面重新设置最新状态
        JSONObject stat = stats.getJSONObject(i);
        QQGroupMember member = group.getMemberByUin(stat.getLong("uin"));
        member.setClientType(QQClientType.valueOfRaw(stat.getInt("client_type")));
        member.setStatus(QQStatus.valueOfRaw(stat.getInt("stat")));
      }
     
      //results/cards
      if(json.has("cards")){
        JSONArray cards = json.getJSONArray("cards");
        for(int i=0; i<cards.length(); i++){
          JSONObject card = cards.getJSONObject(i);
          QQGroupMember member = group.getMemberByUin(card.getLong("muin"));
          if( card != null && card.has("card") && member != null ) {
            member.setCard(card.getString("card"));
          }
        }
      }
     
      //results/vipinfo
      JSONArray vipinfos = json.getJSONArray("vipinfo");
      for(int i=0; i<vipinfos.length(); i++){
        JSONObject vipinfo = vipinfos.getJSONObject(i);
        QQGroupMember member = group.getMemberByUin(vipinfo.getLong("u"));
        member.setVipLevel(vipinfo.getInt("vip_level"));
        member.setVip(vipinfo.getInt("is_vip") == 1);
      }
     
      notifyActionEvent(QQActionEvent.Type.EVT_OK, group);
    }else{
      notifyActionEvent(QQActionEvent.Type.EVT_ERROR, QQErrorCode.UNEXPECTED_RESPONSE);
View Full Code Here

      //result/stats
      JSONArray stats = json.getJSONArray("stats");
      for(int i=0; i<stats.length(); i++){
        // 下面重新设置最新状态
        JSONObject stat = stats.getJSONObject(i);
        QQGroupMember member = group.getMemberByUin(stat.getLong("uin"));
        if(member != null){
          member.setClientType(QQClientType.valueOfRaw(stat.getInt("client_type")));
          member.setStatus(QQStatus.valueOfRaw(stat.getInt("stat")));
        }
      }
     
      notifyActionEvent(QQActionEvent.Type.EVT_OK, group);
    }else{
View Full Code Here

TOP

Related Classes of iqq.im.bean.QQGroupMember

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.