Rework Contacts List Refreshing
This commit is contained in:
parent
37a7807008
commit
ad5345512a
@ -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)
|
public async Task PostMessageAsync(Message message)
|
||||||
{
|
{
|
||||||
await _apiService.RefreshSessionIfInvalid();
|
await _apiService.RefreshSessionIfInvalid();
|
||||||
|
@ -85,14 +85,6 @@ namespace QtCNETAPI.Services.GatewayService
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public Task SendDirectMessageAsync(UserInformationDto user, Message message);
|
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>
|
/// <summary>
|
||||||
/// Updates The Status For The Current User
|
/// Updates The Status For The Current User
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -153,8 +153,6 @@ namespace qtc_net_client_2.Forms
|
|||||||
btnAddContact.Enabled = false;
|
btnAddContact.Enabled = false;
|
||||||
using (var ms = new MemoryStream(Resources.RequestSentIcon)) { btnAddContact.Image = Image.FromStream(ms); ms.Dispose(); }
|
using (var ms = new MemoryStream(Resources.RequestSentIcon)) { btnAddContact.Image = Image.FromStream(ms); ms.Dispose(); }
|
||||||
btnCancelRequest.Visible = true;
|
btnCancelRequest.Visible = true;
|
||||||
|
|
||||||
await _gatewayService.RefreshContactsForUser(_userInformationDto);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -166,8 +164,6 @@ namespace qtc_net_client_2.Forms
|
|||||||
btnAddContact.Image = Resources.AddContactIcon;
|
btnAddContact.Image = Resources.AddContactIcon;
|
||||||
btnAddContact.Click += btnAddContact_Click_Add;
|
btnAddContact.Click += btnAddContact_Click_Add;
|
||||||
btnMessage.Visible = false;
|
btnMessage.Visible = false;
|
||||||
|
|
||||||
await _gatewayService.RefreshContactsForUser(_userInformationDto);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -183,8 +179,6 @@ namespace qtc_net_client_2.Forms
|
|||||||
btnAddContact.Image = Resources.RemoveContactIcon;
|
btnAddContact.Image = Resources.RemoveContactIcon;
|
||||||
btnAddContact.Click += btnAddContact_Click_Remove;
|
btnAddContact.Click += btnAddContact_Click_Remove;
|
||||||
if (_userInformationDto.Status >= 1) btnMessage.Visible = true;
|
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.Visible = true;
|
||||||
btnAddContact.Image = Resources.AddContactIcon;
|
btnAddContact.Image = Resources.AddContactIcon;
|
||||||
btnAddContact.Click += btnAddContact_Click_Add;
|
btnAddContact.Click += btnAddContact_Click_Add;
|
||||||
|
|
||||||
await _gatewayService.RefreshContactsForUser(_userInformationDto);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -214,8 +206,6 @@ namespace qtc_net_client_2.Forms
|
|||||||
btnAddContact.Click += btnAddContact_Click_Add;
|
btnAddContact.Click += btnAddContact_Click_Add;
|
||||||
|
|
||||||
btnCancelRequest.Visible = false;
|
btnCancelRequest.Visible = false;
|
||||||
|
|
||||||
await _gatewayService.RefreshContactsForUser(_userInformationDto);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user