Rework Contacts List Refreshing

This commit is contained in:
Alan Moon 2025-07-06 10:22:29 -07:00
parent 37a7807008
commit ad5345512a
3 changed files with 0 additions and 27 deletions

View File

@ -146,15 +146,6 @@ namespace QtCNETAPI.Services.GatewayService
}
}
public async Task RefreshContactsForUser(UserInformationDto user)
{
await _apiService.RefreshSessionIfInvalid();
if (HubConnection == null || HubConnection.State != HubConnectionState.Connected) throw new InvalidOperationException("Function was called before connection was made.");
await HubConnection.SendAsync("RefreshContactsListOnUser", user, _apiService.CurrentUser);
}
public async Task PostMessageAsync(Message message)
{
await _apiService.RefreshSessionIfInvalid();

View File

@ -85,14 +85,6 @@ namespace QtCNETAPI.Services.GatewayService
/// <returns></returns>
public Task SendDirectMessageAsync(UserInformationDto user, Message message);
/// <summary>
/// Refreshes Contacts List For A Specified User
/// </summary>
/// <param name="user">The User You Wish To Refresh</param>
/// <param name="currentUser">Yourself</param>
/// <returns></returns>
public Task RefreshContactsForUser(UserInformationDto user);
/// <summary>
/// Updates The Status For The Current User
/// </summary>

View File

@ -153,8 +153,6 @@ namespace qtc_net_client_2.Forms
btnAddContact.Enabled = false;
using (var ms = new MemoryStream(Resources.RequestSentIcon)) { btnAddContact.Image = Image.FromStream(ms); ms.Dispose(); }
btnCancelRequest.Visible = true;
await _gatewayService.RefreshContactsForUser(_userInformationDto);
}
}
@ -166,8 +164,6 @@ namespace qtc_net_client_2.Forms
btnAddContact.Image = Resources.AddContactIcon;
btnAddContact.Click += btnAddContact_Click_Add;
btnMessage.Visible = false;
await _gatewayService.RefreshContactsForUser(_userInformationDto);
}
}
@ -183,8 +179,6 @@ namespace qtc_net_client_2.Forms
btnAddContact.Image = Resources.RemoveContactIcon;
btnAddContact.Click += btnAddContact_Click_Remove;
if (_userInformationDto.Status >= 1) btnMessage.Visible = true;
await _gatewayService.RefreshContactsForUser(_userInformationDto);
}
}
@ -199,8 +193,6 @@ namespace qtc_net_client_2.Forms
btnAddContact.Visible = true;
btnAddContact.Image = Resources.AddContactIcon;
btnAddContact.Click += btnAddContact_Click_Add;
await _gatewayService.RefreshContactsForUser(_userInformationDto);
}
}
@ -214,8 +206,6 @@ namespace qtc_net_client_2.Forms
btnAddContact.Click += btnAddContact_Click_Add;
btnCancelRequest.Visible = false;
await _gatewayService.RefreshContactsForUser(_userInformationDto);
}
}