Exemplo n.º 1
0
 public FizzJsonGroupMember(JSONNode json)
 {
     UserId  = json[KEY_USER_ID];
     GroupId = json[KEY_GROUP_ID];
     State   = FizzUtils.ParseState(json[KEY_STATE]);
     Role    = FizzUtils.ParseRole(json[KEY_ROLE]);
 }
Exemplo n.º 2
0
 public FizzJsonGroupMember(string userId, string groupId, string role, string state)
 {
     UserId  = userId;
     GroupId = groupId;
     State   = FizzUtils.ParseState(role);
     Role    = FizzUtils.ParseRole(state);
 }
 public FizzJsonUserGroup(JSONNode json)
 {
     GroupId = json[KEY_GROUP_ID];
     State   = FizzUtils.ParseState(json[KEY_STATE]);
     Role    = FizzUtils.ParseRole(json[KEY_ROLE]);
     if (json[KEY_LAST_READ_MESSAGE_ID] != null)
     {
         LastReadMessageId = (long)json[KEY_LAST_READ_MESSAGE_ID].AsDouble;
     }
     Created = (long)json[KEY_CREATED].AsDouble;
 }
        private FizzGroupMemberEventData ParseMemberEventData(FizzTopicMessage message)
        {
            JSONClass payload             = JSONNode.Parse(message.Data).AsObject;
            FizzGroupMemberEventData data = new FizzGroupMemberEventData();

            data.MemberId = payload["id"];
            data.GroupId  = message.From;
            data.State    = FizzUtils.ParseState(payload["state"]);
            data.Role     = FizzUtils.ParseRole(payload["role"]);

            return(data);
        }