Reference Source
import User from 'flarum/models/User.js'
public class | source

User

Method Summary

Public Methods
public

Get the Badge components that apply to this user.

public

Check whether or not the user has been seen in the last 5 minutes.

public

savePreferences(newPreferences: Object): Promise

Update the user's preferences.

Protected Methods
protected

Calculate the dominant color of the user's avatar. The dominant color will be set to the avatarColor property once it has been calculated.

Public Methods

public badges(): ItemList source

Get the Badge components that apply to this user.

Return:

ItemList

public isOnline(): Boolean source

Check whether or not the user has been seen in the last 5 minutes.

Return:

Boolean

public savePreferences(newPreferences: Object): Promise source

Update the user's preferences.

Params:

NameTypeAttributeDescription
newPreferences Object

Return:

Promise

Protected Methods

protected calculateAvatarColor() source

Calculate the dominant color of the user's avatar. The dominant color will be set to the avatarColor property once it has been calculated.