#include <user.h>
This class provides an interface to a given user's profile.
- Note
- The User class is not intended for getting the data to visualise a user in the context of a particular room. For that a Quotient::RoomMember object should be obtained from a Quotient::Room as this will account for the user setting an avatar or name that applies to that room only.
- See also
- Quotient::RoomMember
Definition at line 25 of file user.h.
◆ User()
Quotient::User::User |
( |
QString |
userId, |
|
|
Connection * |
connection |
|
) |
| |
◆ avatar() [1/2]
◆ avatar() [2/2]
◆ avatarMediaId()
QString Quotient::User::avatarMediaId |
( |
| ) |
const |
◆ avatarObject()
Avatar& Quotient::User::avatarObject |
( |
| ) |
|
◆ avatarUrl()
QUrl Quotient::User::avatarUrl |
( |
| ) |
const |
◆ connection()
◆ defaultAvatarChanged
void Quotient::User::defaultAvatarChanged |
( |
| ) |
|
|
signal |
The default avatar of the user has changed.
◆ defaultNameChanged
void Quotient::User::defaultNameChanged |
( |
| ) |
|
|
signal |
The default name of the user has changed.
◆ displayname()
QString Quotient::User::displayname |
( |
| ) |
const |
Get the name to show on the user's profile.
This is intended to always give you something that can be displayed in a UI. If the user doesn't have a default name or one is not available the user's matrix ID will be used.
- Note
- If you are visualizing a user in a room context you should be using Quotient::RoomMember->displayName() as that will account for the user having a unique name in that room.
- See also
- Quotient::RoomMember::displayname()
◆ fullName()
QString Quotient::User::fullName |
( |
| ) |
const |
Get user's profilename and id in one string.
This is intended to always give you something that can be displayed in a UI. If the user doesn't have a default name or one is not available the fucntion will return the user's matrix ID only.
- Note
- If you are visualizing a user in a room context you should be using Quotient::RoomMember->fullName() as that will account for the user having a unique name in that room.
- See also
- Quotient::RoomMember::fullName()
◆ id()
QString Quotient::User::id |
( |
| ) |
const |
Get unique stable user id.
The Matrix user ID is generated by the server and is never changed.
◆ ignore
void Quotient::User::ignore |
( |
| ) |
const |
|
slot |
Add the user to the ignore list.
◆ isGuest()
bool Quotient::User::isGuest |
( |
| ) |
const |
Whether the user is a guest.
As of now, the function relies on the convention used in Synapse that guests and only guests have all-numeric IDs. This may or may not work with non-Synapse servers.
◆ isIgnored
bool Quotient::User::isIgnored |
( |
| ) |
const |
|
slot |
Check whether the user is in ignore list.
◆ load
void Quotient::User::load |
( |
| ) |
|
|
slot |
Force loading display name and avatar URL.
This is required in some cases where the you need a user's default details independent of the room, e.g. in a profile page.
◆ name()
QString Quotient::User::name |
( |
| ) |
const |
Get the default user name.
This may be empty if the user has not set one.
- Note
- If you are visualizing a user in a room context you should be using Quotient::RoomMember->name() as that will account for the user having a unique name in that room.
- See also
- Quotient::RoomMember::name()
◆ removeAvatar
void Quotient::User::removeAvatar |
( |
| ) |
const |
|
slot |
Removes the avatar from the profile.
◆ rename [1/2]
void Quotient::User::rename |
( |
const QString & |
newName | ) |
|
|
slot |
Set a new name in the global user profile.
◆ rename [2/2]
void Quotient::User::rename |
( |
const QString & |
newName, |
|
|
Room * |
r |
|
) |
| |
|
slot |
Set a new name for the user in one room.
◆ requestDirectChat
void Quotient::User::requestDirectChat |
( |
| ) |
|
|
slot |
◆ setAvatar() [1/2]
Q_INVOKABLE bool Quotient::User::setAvatar |
( |
const QString & |
fileName | ) |
|
Upload the file and use it as an avatar.
◆ setAvatar() [2/2]
Q_INVOKABLE bool Quotient::User::setAvatar |
( |
QIODevice * |
source | ) |
|
Upload contents of the QIODevice and set that as an avatar.
◆ unmarkIgnore
void Quotient::User::unmarkIgnore |
( |
| ) |
const |
|
slot |
Remove the user from the ignore list.
◆ avatarMediaId
QString Quotient::User::avatarMediaId |
|
read |
Definition at line 1 of file user.h.
◆ avatarUrl
QUrl Quotient::User::avatarUrl |
|
read |
Definition at line 1 of file user.h.
◆ displayName
QString Quotient::User::displayName |
|
read |
Definition at line 1 of file user.h.
◆ fullName
QString Quotient::User::fullName |
|
read |
Definition at line 1 of file user.h.
◆ id
QString Quotient::User::id |
|
read |
Definition at line 1 of file user.h.
◆ isGuest
bool Quotient::User::isGuest |
|
read |
Definition at line 1 of file user.h.
◆ name
QString Quotient::User::name |
|
read |
Definition at line 1 of file user.h.
The documentation for this class was generated from the following file: