Reimplement Contact List Images
This commit is contained in:
parent
1e220a23a1
commit
9b350d4373
@ -893,15 +893,20 @@ namespace qtcnet_client
|
||||
{
|
||||
case Contact.ContactStatus.AwaitingApprovalFromOther:
|
||||
ctrl.Username = $"{user.Data.Username} [Request Sent]";
|
||||
//await AddProfilePicToList(user.Data.Id);
|
||||
//ctrl.Avatar = ilProfilePics.Images[user.Data.Id] ?? ilProfilePics.Images[0];
|
||||
break;
|
||||
case Contact.ContactStatus.Accepted:
|
||||
ctrl.Username = user.Data.Username;
|
||||
//await AddProfilePicToList(user.Data.Id);
|
||||
//ctrl.Avatar = ilProfilePics.Images[user.Data.Id] ?? ilProfilePics.Images[0];
|
||||
break;
|
||||
}
|
||||
|
||||
// get profile image
|
||||
var _pfpRes = await _apiService.GetUserProfilePic(contact.UserId);
|
||||
if(_pfpRes.Success && _pfpRes.Data != null)
|
||||
{
|
||||
using var ms = new MemoryStream(_pfpRes.Data);
|
||||
Image img = Image.FromStream(ms);
|
||||
ctrl.ProfilePic = img;
|
||||
}
|
||||
}
|
||||
else if (contact.UserId == _apiService.CurrentUser.Id)
|
||||
{
|
||||
@ -909,16 +914,21 @@ namespace qtcnet_client
|
||||
{
|
||||
case Contact.ContactStatus.AwaitingApprovalFromSelf:
|
||||
ctrl.Username = $"{user.Data.Username} [Contact Request]";
|
||||
//await AddProfilePicToList(user.Data.Id);
|
||||
//ctrl.Avatar = ilProfilePics.Images[user.Data.Id] ?? ilProfilePics.Images[0];
|
||||
//AudioService.PlaySoundEffect("sndContactRequest");
|
||||
break;
|
||||
case Contact.ContactStatus.Accepted:
|
||||
ctrl.Username = user.Data.Username;
|
||||
//await AddProfilePicToList(user.Data.Id);
|
||||
//ctrl.Avatar = ilProfilePics.Images[user.Data.Id] ?? ilProfilePics.Images[0];
|
||||
break;
|
||||
}
|
||||
|
||||
// get profile image
|
||||
var _pfpRes = await _apiService.GetUserProfilePic(contact.OwnerId);
|
||||
if (_pfpRes.Success && _pfpRes.Data != null)
|
||||
{
|
||||
using var ms = new MemoryStream(_pfpRes.Data);
|
||||
Image img = Image.FromStream(ms);
|
||||
ctrl.ProfilePic = img;
|
||||
}
|
||||
}
|
||||
|
||||
// return the control
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user