public void MessageChangedCallback(string jsonParam)
 {
     if (EMClient.Instance.receiveMessageCallback != null)
     {
         EMClient.Instance.receiveMessageCallback.onMessageChangedCallback(EMTools.json2messagelist(jsonParam));
     }
 }
        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 #8
0
        public EMConversation getConversation(string cid, ConversationType type, bool createIfNotExists)
        {
            string data = sdk.getConversation(cid, (int)type, createIfNotExists);

            return(EMTools.json2conversation(data));
        }
Beispiel #9
0
        public EMGroup getGroup(string groupId)
        {
            string jsondata = sdk.getGroup(groupId);

            return(EMTools.json2group(jsondata));
        }
Beispiel #10
0
        public List <EMGroup> getAllGroups()
        {
            string jsondata = sdk.getAllGroups();

            return(EMTools.json2grouplist(jsondata));
        }
Beispiel #11
0
        public List <EMConversation> GetAllConversations()
        {
            string jsonData = sdk.getAllConversations();

            return(EMTools.json2conversationlist(jsonData));
        }
Beispiel #12
0
        public EMMessage GetLatestMessage(string username)
        {
            string retData = sdk.getLatestMessage(username);

            return(EMTools.json2message(retData));
        }
Beispiel #13
0
        public List <EMMessage> GetConversationMessage(string username, string startMsgId, int pageSize)
        {
            string jsonData = sdk.getConversationMessage(username, startMsgId, pageSize);

            return(EMTools.json2messagelist(jsonData));
        }
Beispiel #14
0
        public List <EMMessage> GetAllConversationMessage(string username)
        {
            string jsonData = sdk.getAllConversationMessage(username);

            return(EMTools.json2messagelist(jsonData));
        }