profiles: online status and friend rework
This commit is contained in:
@ -59,19 +59,19 @@ export class Profile extends AExchangeable
|
||||
if (response.status !== 200)
|
||||
return response.status;
|
||||
|
||||
let response_data = await response.json();
|
||||
this.id = response_data.id;
|
||||
this.username = response_data.username;
|
||||
this.avatar = response_data.avatar;
|
||||
this.online = response_data.online
|
||||
const responseData = await response.json();
|
||||
this.id = responseData.id;
|
||||
this.username = responseData.username;
|
||||
this.avatar = responseData.avatar;
|
||||
this.online = responseData.online
|
||||
|
||||
if (!this.client.me || this.client.me.id === this.id)
|
||||
return;
|
||||
|
||||
this.hasIncomingRequest = responseData.has_incoming_request;
|
||||
this.hasOutgoingRequest = responseData.has_outgoing_request;
|
||||
this.isFriend = responseData.is_friend;
|
||||
this.isBlocked = this.client.me._isBlocked(this);
|
||||
this.hasIncomingRequest = this.client.me._hasIncomingRequestFrom(this);
|
||||
this.hasOutgoingRequest = this.client.me._hasOutgoingRequestTo(this);
|
||||
this.isFriend = this.client.me._isFriend(this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user