internal static async Task LeaveRoom(string roomID) { try { if (string.IsNullOrEmpty(roomID)) { roomID = await Logic.GetRoomID(); } string url = $"chat/leave?id={roomID}"; await BaseClient.GetEntities(url); } catch (Exception ex) { Crashes.TrackError(ex, Logic.GetErrorProperties(ex)); } }
internal static async Task <ObservableCollection <ChatLoader> > ChatsByRoom(string roomID) { try { if (string.IsNullOrEmpty(roomID)) { roomID = await Logic.GetRoomID(); } string url = $"chat/fetchchats?roomID={roomID}"; string content = await BaseClient.GetEntities(url); ObservableCollection <ChatLoader> data = JsonConvert.DeserializeObject <ObservableCollection <ChatLoader> >(content); return(data); } catch (Exception ex) { Crashes.TrackError(ex, Logic.GetErrorProperties(ex)); return(new ObservableCollection <ChatLoader>() { }); } }