Class RoomItemViewModel
One room in the room list: name, latest message, unread count, and whether it is an invite, a direct chat or encrypted.
Inheritance
RoomItemViewModel
Assembly: Uniform.Chat.Avalonia.dll
public sealed class RoomItemViewModel : ViewModelBase, INotifyPropertyChanged, INotifyPropertyChanging
Constructors
|
Edit this page
View Source
One room in the room list: name, latest message, unread count, and whether it is an invite, a direct chat or encrypted.
Declaration
public RoomItemViewModel(string roomId)
Parameters
| Type |
Name |
Description |
| string |
roomId |
|
Properties
|
Edit this page
View Source
Declaration
[ObservableProperty]
[NotifyPropertyChangedFor("HasAvatar")]
[ExcludeFromCodeCoverage]
public Bitmap? Avatar { get; set; }
Property Value
|
Edit this page
View Source
mxc:// URI of the room's avatar, or null.
Declaration
public string? AvatarUri { get; }
Property Value
|
Edit this page
View Source
Declaration
public bool HasAvatar { get; }
Property Value
|
Edit this page
View Source
Declaration
public bool HasLastMessage { get; }
Property Value
|
Edit this page
View Source
Whether there are unread messages.
Declaration
public bool HasUnread { get; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[ExcludeFromCodeCoverage]
public string Initial { get; set; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[ExcludeFromCodeCoverage]
public bool IsDirect { get; set; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[ExcludeFromCodeCoverage]
public bool IsEncrypted { get; set; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[ExcludeFromCodeCoverage]
public bool IsFavourite { get; set; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[ExcludeFromCodeCoverage]
public bool IsHighlighted { get; set; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[ExcludeFromCodeCoverage]
public bool IsInvite { get; set; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[ExcludeFromCodeCoverage]
public bool IsLowPriority { get; set; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[ExcludeFromCodeCoverage]
public bool IsOneToOne { get; set; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[ExcludeFromCodeCoverage]
public bool IsServerNotice { get; set; }
Property Value
|
Edit this page
View Source
Time of the latest message, for ordering; the minimum when none is loaded.
Declaration
public DateTimeOffset LastActivity { get; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[NotifyPropertyChangedFor("HasLastMessage")]
[ExcludeFromCodeCoverage]
public string LastMessage { get; set; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[ExcludeFromCodeCoverage]
public string LastTime { get; set; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[ExcludeFromCodeCoverage]
public string Name { get; set; }
Property Value
|
Edit this page
View Source
Declaration
public string RoomId { get; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[ExcludeFromCodeCoverage]
public string? Topic { get; set; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[NotifyPropertyChangedFor("HasUnread", new string[] { "UnreadText" })]
[ExcludeFromCodeCoverage]
public int Unread { get; set; }
Property Value
|
Edit this page
View Source
UnreadText
Unread count as shown, e.g. 99+.
Declaration
public string UnreadText { get; }
Property Value
Methods
|
Edit this page
View Source
Copy the room's current state; call under the room store's lock.
Declaration
public void Update(Room room, bool isRead, string ownUserId, DateTimeOffset now)
Parameters
| Type |
Name |
Description |
| Room |
room |
The room.
|
| bool |
isRead |
Whether it has nothing unread: the open room, or one marked read up to its newest event.
|
| string |
ownUserId |
The user, whose messages show as from You.
|
| DateTimeOffset |
now |
Current time, for LastTime.
|
Implements