Exemple #1
0
        public async Task <bool> ArchiveAsync(string sessionId)
        {
            string url = $"api/channels/{sessionId}/archive";
            var    res = await WtHttpClient.PutAsync <ApiDataResponse <bool> >(url);

            return(res.Code == 200 && res.Data);
        }
Exemple #2
0
        public async Task <bool> JoinChannelAsync(string sessionId)
        {
            string url  = $"api/channels/{sessionId}/join";
            var    data = await WtHttpClient.PutAsync <ApiDataResponse <bool> >(url);

            return(data.Code == 200 && data.Data);
        }
Exemple #3
0
        public async Task <bool> ActiveChannelAsync(string sessionId)
        {
            string url  = $"api/channels/{sessionId}/active";
            var    data = await WtHttpClient.PutAsync <ApiResponse>(url);

            return(data.Code == 200);
        }
Exemple #4
0
        public async Task <bool> ClearUnReadAsync(string sessionId)
        {
            string url  = $"api/messages/unread/clear?ref_id={sessionId}";
            var    data = await WtHttpClient.PutAsync <ApiResponse>(url);

            return(data.Code == 200);
        }
Exemple #5
0
        public async Task <bool> UnStarSessionAsync(ISession session)
        {
            string sessionType = session.GetType() == typeof(ChannelSession) ? "channels" : "sessions";
            string url         = $"/api/{sessionType}/{session.Id}/unstar";
            var    data        = await WtHttpClient.PutAsync <ApiDataResponse <bool> >(url);

            return(data.Code == 200 && data.Data);
        }
Exemple #6
0
        public async Task <bool> AddMemberToChannelAsync(string sessionId, string uid)
        {
            string url = $"api/channels/{sessionId}/invite";
            var    req = new { uid };
            var    res = await WtHttpClient.PutAsync <ApiDataResponse <bool> >(url, req);

            return(res.Code == 200 && res.Data);
        }
Exemple #7
0
        public async Task <bool> ShareAsync(string fileId, string sessionId, ToType toType)
        {
            string url = $"api/entities/{fileId}/share";
            var    req = new
            {
                ref_id   = sessionId,
                ref_type = toType
            };
            var res = await WtHttpClient.PutAsync <ApiDataResponse <bool> >(url, req);

            return(res.Code == 200 && res.Data);
        }
Exemple #8
0
        public async Task <bool> UpdateChannelAsync(string sessionId, string name, string desc, string color)
        {
            string url = $"api/channels/{sessionId}";
            var    req = new
            {
                color,
                desc,
                name
            };
            var res = await WtHttpClient.PutAsync <ApiDataResponse <bool> >(url, req);

            return(res.Code == 200 && res.Data);
        }