public void AcceptInvitationFromGroupCallback(string jsonParam)
        {
            JsonData        jsonData   = JsonMapper.ToObject(jsonParam);
            int             callbackId = (int)jsonData ["callbackid"];
            string          on         = (string)jsonData ["on"];
            EMGroupCallback cb         = (EMGroupCallback)EMClient.Instance.GetCallbackById(callbackId);

            if (on.Equals("success"))
            {
                EMGroup group = EMTools.json2group((string)jsonData ["data"]);
                cb.onSuccessJoinGroupCallback(group);
                EMClient.Instance.RemoveCallbackById(callbackId);
            }
            else if (on.Equals("error"))
            {
                cb.onErrorCallback((int)jsonData ["code"], (string)jsonData ["message"]);
            }
        }
        public void GetBlockedUsersCallback(string jsonParam)
        {
            JsonData        jsonData   = JsonMapper.ToObject(jsonParam);
            int             callbackId = (int)jsonData ["callbackid"];
            string          on         = (string)jsonData ["on"];
            EMGroupCallback cb         = (EMGroupCallback)EMClient.Instance.GetCallbackById(callbackId);

            if (on.Equals("success"))
            {
                string strUsers = (string)jsonData ["data"];
                cb.onSuccessGetBlockedUsers(EMTools.string2list(strUsers));
                EMClient.Instance.RemoveCallbackById(callbackId);
            }
            else if (on.Equals("error"))
            {
                cb.onErrorCallback((int)jsonData ["code"], (string)jsonData ["message"]);
            }
        }
        public void GetJoinedGroupsFromServerCallback(string jsonParam)
        {
            JsonData        jsonData   = JsonMapper.ToObject(jsonParam);
            int             callbackId = (int)jsonData ["callbackid"];
            string          on         = (string)jsonData ["on"];
            EMGroupCallback cb         = (EMGroupCallback)EMClient.Instance.GetCallbackById(callbackId);

            if (on.Equals("success"))
            {
                List <EMGroup> groups = EMTools.json2grouplist((string)jsonData ["data"]);
                cb.onSuccessGetGroupListCallback(groups);
                EMClient.Instance.RemoveCallbackById(callbackId);
            }
            else if (on.Equals("error"))
            {
                cb.onErrorCallback((int)jsonData ["code"], (string)jsonData ["message"]);
            }
        }
        public void AcceptInvitationFromGroupCallback(string jsonParam)
        {
            JSONNode        jsonData   = JSON.Parse(jsonParam);
            int             callbackId = jsonData ["callbackid"].AsInt;
            string          on         = jsonData ["on"].Value;
            EMGroupCallback cb         = (EMGroupCallback)EMClient.Instance.GetCallbackById(callbackId);

            if (on.Equals("success"))
            {
                EMGroup group = EMTools.json2group(jsonData ["data"].Value);
                cb.onSuccessJoinGroupCallback(group);
                EMClient.Instance.RemoveCallbackById(callbackId);
            }
            else if (on.Equals("error"))
            {
                cb.onErrorCallback(jsonData ["code"].AsInt, jsonData ["message"].Value);
            }
        }
        public void GetBlockedUsersCallback(string jsonParam)
        {
            JSONNode        jsonData   = JSON.Parse(jsonParam);
            int             callbackId = jsonData ["callbackid"].AsInt;
            string          on         = jsonData ["on"].Value;
            EMGroupCallback cb         = (EMGroupCallback)EMClient.Instance.GetCallbackById(callbackId);

            if (on.Equals("success"))
            {
                string strUsers = jsonData ["data"].Value;
                cb.onSuccessGetBlockedUsers(EMTools.string2list(strUsers));
                EMClient.Instance.RemoveCallbackById(callbackId);
            }
            else if (on.Equals("error"))
            {
                cb.onErrorCallback(jsonData ["code"].AsInt, jsonData ["message"].Value);
            }
        }
        public void GetJoinedGroupsFromServerCallback(string jsonParam)
        {
            JSONNode        jsonData   = JSON.Parse(jsonParam);
            int             callbackId = jsonData ["callbackid"].AsInt;
            string          on         = jsonData ["on"].Value;
            EMGroupCallback cb         = (EMGroupCallback)EMClient.Instance.GetCallbackById(callbackId);

            if (on.Equals("success"))
            {
                List <EMGroup> groups = EMTools.json2grouplist(jsonData ["data"].Value);
                cb.onSuccessGetGroupListCallback(groups);
                EMClient.Instance.RemoveCallbackById(callbackId);
            }
            else if (on.Equals("error"))
            {
                cb.onErrorCallback(jsonData ["code"].AsInt, jsonData ["message"].Value);
            }
        }
Beispiel #7
0
 public void acceptInvitationFromGroup(string groupId, string username, EMGroupCallback cb)
 {
     AddCallbackToList(cb);
     sdk.acceptInvitationFromGroup(cb.CallbackId, groupId, username);
 }
Beispiel #8
0
 public void getBlockedUsers(string groupId, EMGroupCallback cb)
 {
     AddCallbackToList(cb);
     sdk.getBlockedUsers(cb.CallbackId, groupId);
 }
Beispiel #9
0
 public void createGroup(string groupName, string desc, string[] members, string reason, int maxUsers, GroupStyle style, EMGroupCallback cb)
 {
     AddCallbackToList(cb);
     sdk.createGroup(cb.CallbackId, groupName, desc, string.Join(",", members), reason, maxUsers, (int)style);
 }