MOBILE-2962 user: Display online status for current user
parent
bbfe831846
commit
94c1f4fd0d
|
@ -44,7 +44,6 @@ export class CoreUserAvatarComponent implements OnInit, OnChanges, OnDestroy {
|
||||||
// Variable to check if we consider this user online or not.
|
// Variable to check if we consider this user online or not.
|
||||||
// @TODO: Use setting when available (see MDL-63972) so we can use site setting.
|
// @TODO: Use setting when available (see MDL-63972) so we can use site setting.
|
||||||
protected timetoshowusers = 300000; // Miliseconds default.
|
protected timetoshowusers = 300000; // Miliseconds default.
|
||||||
protected myUser = false;
|
|
||||||
protected currentUserId: number;
|
protected currentUserId: number;
|
||||||
protected pictureObs;
|
protected pictureObs;
|
||||||
|
|
||||||
|
@ -91,9 +90,6 @@ export class CoreUserAvatarComponent implements OnInit, OnChanges, OnDestroy {
|
||||||
|
|
||||||
this.userId = this.userId || (this.user && (this.user.userid || this.user.id));
|
this.userId = this.userId || (this.user && (this.user.userid || this.user.id));
|
||||||
this.courseId = this.courseId || (this.user && this.user.courseid);
|
this.courseId = this.courseId || (this.user && this.user.courseid);
|
||||||
|
|
||||||
// If not available we cannot ensure the avatar is from the current user.
|
|
||||||
this.myUser = this.userId && this.userId == this.currentUserId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -102,7 +98,7 @@ export class CoreUserAvatarComponent implements OnInit, OnChanges, OnDestroy {
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
isOnline(): boolean {
|
isOnline(): boolean {
|
||||||
if (this.myUser || this.utils.isFalseOrZero(this.user.isonline)) {
|
if (this.utils.isFalseOrZero(this.user.isonline)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue