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); }
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); }
public async Task <bool> ActiveChannelAsync(string sessionId) { string url = $"api/channels/{sessionId}/active"; var data = await WtHttpClient.PutAsync <ApiResponse>(url); return(data.Code == 200); }
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); }
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); }
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); }
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); }
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); }