libQuotient
A Qt library for building matrix clients
Quotient::Room Class Reference

#include <room.h>

Inheritance diagram for Quotient::Room:
Collaboration diagram for Quotient::Room:

Public Types

enum class  Change : quint32 {
  None = 0x0 , RoomNames = 0x1 , Topic = 0x4 , PartiallyReadStats = 0x8 ,
  Avatar = 0x10 , JoinState = 0x20 , Tags = 0x40 , Members = 0x80 ,
  UnreadStats = 0x100 , Summary = 0x400 , Highlights = 0x1000 , Other = 0x8000 ,
  Any = 0xFFFF
}
 Room changes that can be tracked using Room::changed() signal. More...
 
enum  ActionScope { ThisRoomOnly , WithinSameState , OmitLeftState , WholeSequence }
 The scope to apply an action on. More...
 
using Timeline = std::deque< TimelineItem >
 
using PendingEvents = std::vector< PendingEventItem >
 
using RelatedEvents = QVector< const RoomEvent * >
 
using rev_iter_t = Timeline::const_reverse_iterator
 
using timeline_iter_t = Timeline::const_iterator
 

Public Slots

void checkVersion ()
 
QString postMessage (const QString &plainText, MessageEventType type)
 
QString postPlainText (const QString &plainText)
 
QString postHtmlMessage (const QString &plainText, const QString &html, MessageEventType type=MessageEventType::Text)
 
QString postHtmlText (const QString &plainText, const QString &html)
 
QString postReaction (const QString &eventId, const QString &key)
 Send a reaction on a given event with a given key. More...
 
QString postEvent (RoomEvent *event)
 
QString postJson (const QString &matrixType, const QJsonObject &eventContent)
 
QString retryMessage (const QString &txnId)
 
void discardMessage (const QString &txnId)
 
SetRoomStateWithKeyJobsetState (const QString &evtType, const QString &stateKey, const QJsonObject &contentJson)
 Send a request to update the room state based on freeform inputs. More...
 
void setName (const QString &newName)
 
void setCanonicalAlias (const QString &newAlias)
 
void setPinnedEvents (const QStringList &events)
 
void setLocalAliases (const QStringList &aliases)
 Set room aliases on the user's current server. More...
 
void setTopic (const QString &newTopic)
 
void refreshDisplayName ()
 You shouldn't normally call this method; it's here for debugging. More...
 
JobHandle< GetRoomEventsJobgetPreviousContent (int limit=10, const QString &filter={})
 
void inviteToRoom (const QString &memberId)
 
JobHandle< LeaveRoomJobleaveRoom ()
 
void kickMember (const QString &memberId, const QString &reason={})
 
void ban (const QString &userId, const QString &reason={})
 
void unban (const QString &userId)
 
void redactEvent (const QString &eventId, const QString &reason={})
 
void uploadFile (const QString &id, const QUrl &localFilename, const QString &overrideContentType={})
 
void downloadFile (const QString &eventId, const QUrl &localFilename={})
 
void cancelFileTransfer (const QString &id)
 
void setReadReceipt (const QString &atEventId)
 Set a given event as last read and post a read receipt on it. More...
 
void markAllMessagesAsRead ()
 Put the fully-read marker at the latest message in the room. More...
 
void switchVersion (QString newVersion)
 Switch the room's version (aka upgrade) More...
 
void inviteCall (const QString &callId, const int lifetime, const QString &sdp)
 
void sendCallCandidates (const QString &callId, const QJsonArray &candidates)
 
void answerCall (const QString &callId, const QString &sdp)
 
void hangupCall (const QString &callId)
 
void activateEncryption ()
 

Signals

void baseStateLoaded ()
 Initial set of state events has been loaded. More...
 
void eventsHistoryJobChanged ()
 
void aboutToAddHistoricalMessages (Quotient::RoomEventsRange events)
 
void aboutToAddNewMessages (Quotient::RoomEventsRange events)
 
void addedMessages (int fromIndex, int toIndex)
 
void pendingEventAboutToAdd (Quotient::RoomEvent *event)
 The event is about to be appended to the list of pending events. More...
 
void pendingEventAdded (const Quotient::RoomEvent *event)
 An event has been appended to the list of pending events. More...
 
void pendingEventAboutToMerge (Quotient::RoomEvent *serverEvent, int pendingEventIndex)
 
void pendingEventMerged ()
 The remote and local copies of the event have been merged. More...
 
void pendingEventAboutToDiscard (int pendingEventIndex)
 An event will be removed from the list of pending events. More...
 
void pendingEventDiscarded ()
 An event has just been removed from the list of pending events. More...
 
void pendingEventChanged (int pendingEventIndex)
 The status of a pending event has changed. More...
 
void messageSent (QString txnId, QString eventId)
 The server accepted the message. More...
 
void changed (Quotient::Room::Changes changes)
 
void namesChanged (Quotient::Room *room)
 The room name, the canonical alias or other aliases changed. More...
 
void displaynameAboutToChange (Quotient::Room *room)
 
void displaynameChanged (Quotient::Room *room, QString oldName)
 
void pinnedEventsChanged ()
 
void topicChanged ()
 
void avatarChanged ()
 
void memberJoined (RoomMember member)
 A new member has joined the room. More...
 
void memberLeft (RoomMember member)
 A member who previously joined has left. More...
 
void memberNameAboutToUpdate (RoomMember member, QString newName)
 A known joined member is about to update their display name. More...
 
void memberNameUpdated (RoomMember member)
 A known joined member has updated their display name. More...
 
void memberAvatarUpdated (RoomMember member)
 A known joined member has updated their avatar. More...
 
void memberListChanged ()
 The list of members has changed. More...
 
void allMembersLoaded ()
 
void encryption ()
 
void joinStateChanged (Quotient::JoinState oldState, Quotient::JoinState newState)
 
void typingChanged ()
 The list of members sending typing indicators has changed. More...
 
void highlightCountChanged ()
 
void notificationCountChanged ()
 
void displayedChanged (bool displayed)
 
void firstDisplayedEventChanged ()
 
void lastDisplayedEventChanged ()
 
void lastReadEventChanged (QVector< QString > userIds)
 
void fullyReadMarkerMoved (QString fromEventId, QString toEventId)
 
void partiallyReadStatsChanged ()
 
void unreadStatsChanged ()
 
void allHistoryLoadedChanged ()
 
void accountDataAboutToChange (QString type)
 
void accountDataChanged (QString type)
 
void tagsAboutToChange ()
 
void tagsChanged ()
 
void updatedEvent (QString eventId)
 
void replacedEvent (const Quotient::RoomEvent *newEvent, const Quotient::RoomEvent *oldEvent)
 
void newFileTransfer (QString id, QUrl localFile)
 
void fileTransferProgress (QString id, qint64 progress, qint64 total)
 
void fileTransferCompleted (QString id, QUrl localFile, FileSourceInfo fileMetadata)
 
void fileTransferFailed (QString id, QString errorMessage={})
 
void callEvent (Quotient::Room *room, const Quotient::RoomEvent *event)
 
void stabilityUpdated (QString recommendedDefault, QStringList stableVersions)
 The room's version stability may have changed. More...
 
void upgraded (QString serverMessage, Quotient::Room *successor)
 This room has been upgraded and won't receive updates any more. More...
 
void upgradeFailed (QString errorMessage)
 An attempted room upgrade has failed. More...
 
void beforeDestruction (Quotient::Room *)
 The room is about to be deleted. More...
 

Public Member Functions

 Room (Connection *connection, QString id, JoinState initialJoinState)
 
 ~Room () override
 
Connectionconnection () const
 
RoomMember localMember () const
 Get a RoomMember object for the local user. More...
 
const QString & id () const
 
QString version () const
 
bool isUnstable () const
 
QString predecessorId () const
 
Roompredecessor (JoinStates statesFilter=JoinState::Invite|JoinState::Join) const
 Room predecessor. More...
 
QString successorId () const
 
Roomsuccessor (JoinStates statesFilter=JoinState::Invite|JoinState::Join) const
 Room successor. More...
 
QString name () const
 
QString canonicalAlias () const
 
QStringList altAliases () const
 
QStringList aliases () const
 Get a list of both canonical and alternative aliases. More...
 
QString displayName () const
 
QStringList pinnedEventIds () const
 
QVector< const RoomEvent * > pinnedEvents () const
 
QString displayNameForHtml () const
 
QString topic () const
 
QString avatarMediaId () const
 
QUrl avatarUrl () const
 
const AvataravatarObject () const
 
Q_INVOKABLE JoinState joinState () const
 
int timelineSize () const
 
bool usesEncryption () const
 
RoomEventPtr decryptMessage (const EncryptedEvent &encryptedEvent)
 
void handleRoomKeyEvent (const RoomKeyEvent &roomKeyEvent, const QString &senderId, const QByteArray &olmSessionId, const QByteArray &senderKey, const QByteArray &senderEdKey)
 
int joinedCount () const
 
int invitedCount () const
 
int totalMemberCount () const
 
GetRoomEventsJobeventsHistoryJob () const
 
Q_INVOKABLE QImage avatar (int dimension)
 
Q_INVOKABLE QImage avatar (int width, int height)
 
Q_INVOKABLE RoomMember member (const QString &userId) const
 Get a RoomMember object for the given user Matrix ID. More...
 
QList< RoomMemberjoinedMembers () const
 Get a list of room members who have joined the room. More...
 
QList< RoomMembermembers () const
 Get a list of all members known to the room. More...
 
QList< RoomMembermembersLeft () const
 Get a list of all members known to have left the room. More...
 
QList< RoomMembermembersTyping () const
 Get a list of room members who are currently sending a typing indicator. More...
 
QList< RoomMemberotherMembersTyping () const
 Get a list of room members who are currently sending a typing indicator. More...
 
QStringList joinedMemberIds () const
 Get a list of room member Matrix IDs who have joined the room. More...
 
QStringList memberIds () const
 Get a list of all member Matrix IDs known to the room. More...
 
bool needsDisambiguation (const QString &userId) const
 Whether the name for the given member should be disambiguated. More...
 
Q_INVOKABLE Quotient::Membership memberState (const QString &userId) const
 Check the join state of a given user in this room. More...
 
Q_INVOKABLE bool isMember (const QString &userId) const
 Check whether a user with the given id is a member of the room. More...
 
const AvatarmemberAvatarObject (const QString &memberId) const
 
Q_INVOKABLE QImage memberAvatar (const QString &memberId, int width, int height)
 Get a avatar of the specified dimensions. More...
 
Q_INVOKABLE QImage memberAvatar (const QString &memberId, int dimension)
 Get a square avatar of the specified size. More...
 
const TimelinemessageEvents () const
 
const PendingEventspendingEvents () const
 
int requestedHistorySize () const
 Get the number of requested historical events. More...
 
bool allHistoryLoaded () const
 
rev_iter_t historyEdge () const
 Get a reverse iterator at the position before the "oldest" event. More...
 
Timeline::const_iterator syncEdge () const
 Get an iterator for the position beyond the latest arrived event. More...
 
Q_INVOKABLE Quotient::TimelineItem::index_t minTimelineIndex () const
 
Q_INVOKABLE Quotient::TimelineItem::index_t maxTimelineIndex () const
 
Q_INVOKABLE bool isValidIndex (Quotient::TimelineItem::index_t timelineIndex) const
 
rev_iter_t findInTimeline (TimelineItem::index_t index) const
 
rev_iter_t findInTimeline (const QString &evtId) const
 
PendingEvents::iterator findPendingEvent (const QString &txnId)
 
PendingEvents::const_iterator findPendingEvent (const QString &txnId) const
 
const RelatedEvents relatedEvents (const QString &evtId, EventRelation::reltypeid_t relType) const
 
const RelatedEvents relatedEvents (const RoomEvent &evt, EventRelation::reltypeid_t relType) const
 
const RoomCreateEventcreation () const
 
const RoomTombstoneEventtombstone () const
 
bool displayed () const
 
void setDisplayed (bool displayed=true)
 Mark the room as currently displayed to the user. More...
 
QString firstDisplayedEventId () const
 
rev_iter_t firstDisplayedMarker () const
 
void setFirstDisplayedEventId (const QString &eventId)
 
void setFirstDisplayedEvent (TimelineItem::index_t index)
 
QString lastDisplayedEventId () const
 
rev_iter_t lastDisplayedMarker () const
 
void setLastDisplayedEventId (const QString &eventId)
 
void setLastDisplayedEvent (TimelineItem::index_t index)
 
ReadReceipt lastReadReceipt (const QString &userId) const
 Get the latest read receipt from a user. More...
 
ReadReceipt lastLocalReadReceipt () const
 Get the latest read receipt from the local user. More...
 
rev_iter_t localReadReceiptMarker () const
 Find the timeline item the local read receipt is at. More...
 
QString lastFullyReadEventId () const
 Get the latest event id marked as fully read. More...
 
rev_iter_t fullyReadMarker () const
 Get the iterator to the latest timeline item marked as fully read. More...
 
QSet< QString > userIdsAtEvent (const QString &eventId) const
 Get users whose latest read receipts point to the event. More...
 
Q_INVOKABLE void markMessagesAsRead (const QString &uptoEventId)
 Mark the event with uptoEventId as fully read. More...
 
virtual bool isEventNotable (const TimelineItem &ti) const
 Determine whether an event should be counted as unread. More...
 
Notification notificationFor (const TimelineItem &ti) const
 Get notification details for an event. More...
 
EventStats partiallyReadStats () const
 Get event statistics since the fully read marker. More...
 
EventStats unreadStats () const
 Get event statistics since the last read receipt. More...
 
qsizetype notificationCount () const
 Get the number of notifications since the last read receipt. More...
 
qsizetype highlightCount () const
 Get the number of highlights since the last read receipt. More...
 
bool hasAccountData (const QString &type) const
 
const EventPtraccountData (const QString &type) const
 
QStringList accountDataEventTypes () const
 
QStringList tagNames () const
 
TagsMap tags () const
 
Tag tag (const QString &name) const
 
void addTag (const QString &name, const Tag &tagData={})
 
Q_INVOKABLE void addTag (const QString &name, float order)
 
Q_INVOKABLE void removeTag (const QString &name)
 Remove a tag from the room. More...
 
void setTags (TagsMap newTags, ActionScope applyOn=ThisRoomOnly)
 
bool isFavourite () const
 Check whether the list of tags has m.favourite. More...
 
bool isLowPriority () const
 Check whether the list of tags has m.lowpriority. More...
 
bool isServerNoticeRoom () const
 Check whether this room is for server notices (MSC1452) More...
 
Q_INVOKABLE bool isDirectChat () const
 Check whether this room is a direct chat. More...
 
QList< RoomMemberdirectChatMembers () const
 Get the list of members this room is a direct chat with. More...
 
Q_INVOKABLE QUrl makeMediaUrl (const QString &eventId, const QUrl &mxcUrl) const
 
Q_INVOKABLE QUrl urlToThumbnail (const QString &eventId) const
 
Q_INVOKABLE QUrl urlToDownload (const QString &eventId) const
 
Q_INVOKABLE QString fileNameToDownload (const QString &eventId) const
 Get a file name for downloading for a given event id. More...
 
Q_INVOKABLE Quotient::FileTransferInfo fileTransferInfo (const QString &id) const
 Get information on file upload/download. More...
 
Q_INVOKABLE QUrl fileSource (const QString &id) const
 Get the URL to the actual file source in a unified way. More...
 
Q_INVOKABLE QString prettyPrint (const QString &plainText) const
 
MemberSorter memberSorter () const
 
Q_INVOKABLE bool supportsCalls () const
 
Q_INVOKABLE bool canSwitchVersions () const
 Whether the current user is allowed to upgrade the room. More...
 
RoomStateView currentState () const
 Get the current room state. More...
 
Q_INVOKABLE int memberEffectivePowerLevel (const QString &memberId={}) const
 The effective power level of the given member in the room. More...
 
Q_INVOKABLE int powerLevelFor (const QString &eventTypeId, bool forceStateEvent=false) const
 Get the power level required to send events of the given type. More...
 
template<EventClass EvT>
int powerLevelFor () const
 Get the power level required to send events of the given type. More...
 
const PendingEventItempost (RoomEventPtr event)
 Post a pre-created room message event. More...
 
template<typename EvT , typename... ArgTs>
const PendingEventItempost (ArgTs &&... args)
 
QString postFile (const QString &plainText, std::unique_ptr< EventContent::FileContentBase > fileContent)
 
PendingEventItem::future_type whenMessageMerged (QString txnId) const
 
SetRoomStateWithKeyJobsetState (const StateEvent &evt)
 Send a request to update the room state with the given event. More...
 
template<typename EvT , typename... ArgTs>
auto setState (ArgTs &&... args)
 Set a state event of the given type with the given arguments. More...
 
void addMegolmSessionFromBackup (const QByteArray &sessionId, const QByteArray &sessionKey, uint32_t index, const QByteArray &senderKey, const QByteArray &senderEdKey)
 
Q_INVOKABLE void startVerification ()
 
QJsonArray exportMegolmSessions ()
 

Protected Member Functions

virtual Changes processStateEvent (const RoomEvent &e)
 
virtual Changes processEphemeralEvent (EventPtr &&event)
 
virtual Changes processAccountDataEvent (EventPtr &&event)
 
virtual void onAddNewTimelineEvents (timeline_iter_t)
 
virtual void onAddHistoricalTimelineEvents (rev_iter_t)
 
virtual void onRedaction (const RoomEvent &, const RoomEvent &)
 
virtual QJsonObject toJson () const
 
virtual void updateData (SyncRoomData &&data, bool fromCache=false)
 
virtual Notification checkForNotifications (const TimelineItem &ti)
 

Properties

Connectionconnection
 
RoomMember localMember
 
QString id
 
QString version
 
bool isUnstable
 
QString predecessorId
 
QString successorId
 
QString name
 
QStringList aliases
 
QStringList altAliases
 
QString canonicalAlias
 
QString displayName
 
QStringList pinnedEventIds
 
QString displayNameForHtml
 
QString topic
 
QString avatarMediaId
 
QUrl avatarUrl
 
bool usesEncryption
 
int timelineSize
 
int joinedCount
 
int invitedCount
 
int totalMemberCount
 
QList< RoomMembermembersTyping
 
QList< RoomMemberotherMembersTyping
 
int localMemberEffectivePowerLevel
 
bool displayed
 
QString firstDisplayedEventId
 
QString lastDisplayedEventId
 
QString lastFullyReadEventId
 
qsizetype highlightCount
 
qsizetype notificationCount
 
EventStats partiallyReadStats
 
EventStats unreadStats
 
bool allHistoryLoaded
 
QStringList tagNames
 
bool isFavourite
 
bool isLowPriority
 
GetRoomEventsJobeventsHistoryJob
 
int requestedHistorySize
 
QStringList accountDataEventTypes
 

Friends

class Connection
 

Detailed Description

Definition at line 117 of file room.h.

Member Typedef Documentation

◆ PendingEvents

Definition at line 175 of file room.h.

◆ RelatedEvents

using Quotient::Room::RelatedEvents = QVector<const RoomEvent*>

Definition at line 176 of file room.h.

◆ rev_iter_t

using Quotient::Room::rev_iter_t = Timeline::const_reverse_iterator

Definition at line 177 of file room.h.

◆ Timeline

Definition at line 174 of file room.h.

◆ timeline_iter_t

using Quotient::Room::timeline_iter_t = Timeline::const_iterator

Definition at line 178 of file room.h.

Member Enumeration Documentation

◆ ActionScope

The scope to apply an action on.

This enumeration is used to pick a strategy to propagate certain actions on the room to its predecessors and successors.

Enumerator
ThisRoomOnly 

Do not apply to predecessors and successors.

WithinSameState 

Apply to predecessors and successors in the same state as the current one

OmitLeftState 

Apply to all reachable predecessors and successors except those in Leave state

WholeSequence 

Apply to all reachable predecessors and successors.

Definition at line 590 of file room.h.

◆ Change

enum Quotient::Room::Change : quint32
strong

Room changes that can be tracked using Room::changed() signal.

This enumeration lists kinds of changes that can be tracked with a "cumulative" changed() signal instead of using individual signals for each change. Specific enumerators mention these individual signals.

See also
changed
Enumerator
None 

No changes occurred in the room.

RoomNames 
See also
namesChanged, displaynameChanged
Topic 
See also
topicChanged
PartiallyReadStats 
See also
partiallyReadStatsChanged
Avatar 
See also
avatarChanged
JoinState 
See also
joinStateChanged
Tags 
See also
tagsChanged
Members 
See also
userAdded, userRemoved, memberRenamed, memberListChanged, displaynameChanged
UnreadStats 
See also
unreadStatsChanged
Summary 
See also
summaryChanged, displaynameChanged
Highlights 
See also
highlightCountChanged
Other 

A catch-all value that covers changes not listed above (such as encryption turned on or the room having been upgraded), as well as changes in the room state that the library is not aware of (e.g., custom state events) and m.read/m.fully_read position changes.

See also
encryptionChanged, upgraded, accountDataChanged
Any 

This is intended to test a Change/Changes value for non-emptiness; adding & Change::Any has the same meaning as !testFlag(Change::None) or adding != Change::None

Note
testFlag(Change::Any) tests that all bits are on and will always return false.

Definition at line 186 of file room.h.

Constructor & Destructor Documentation

◆ Room()

Quotient::Room::Room ( Connection connection,
QString  id,
JoinState  initialJoinState 
)

◆ ~Room()

Quotient::Room::~Room ( )
override

Member Function Documentation

◆ aboutToAddHistoricalMessages

void Quotient::Room::aboutToAddHistoricalMessages ( Quotient::RoomEventsRange  events)
signal

◆ aboutToAddNewMessages

void Quotient::Room::aboutToAddNewMessages ( Quotient::RoomEventsRange  events)
signal

◆ accountData()

const EventPtr& Quotient::Room::accountData ( const QString &  type) const

Get a generic account data event of the given type This returns a generic hash map for any room account data event stored on the server. Tags and read markers cannot be retrieved using this method yet.

◆ accountDataAboutToChange

void Quotient::Room::accountDataAboutToChange ( QString  type)
signal

◆ accountDataChanged

void Quotient::Room::accountDataChanged ( QString  type)
signal

◆ accountDataEventTypes()

QStringList Quotient::Room::accountDataEventTypes ( ) const

Get a list of all room account data events

Returns
A list of event types that exist in the room

◆ activateEncryption

void Quotient::Room::activateEncryption ( )
slot

Activates encryption for this room. Warning: Cannot be undone

◆ addedMessages

void Quotient::Room::addedMessages ( int  fromIndex,
int  toIndex 
)
signal

◆ addMegolmSessionFromBackup()

void Quotient::Room::addMegolmSessionFromBackup ( const QByteArray &  sessionId,
const QByteArray &  sessionKey,
uint32_t  index,
const QByteArray &  senderKey,
const QByteArray &  senderEdKey 
)

◆ addTag() [1/2]

void Quotient::Room::addTag ( const QString &  name,
const Tag tagData = {} 
)

Add a new tag to this room If this room already has this tag, nothing happens. If it's a new tag for the room, the respective tag record is added to the set of tags and the new set is sent to the server to update other clients.

◆ addTag() [2/2]

Q_INVOKABLE void Quotient::Room::addTag ( const QString &  name,
float  order 
)

◆ aliases()

QStringList Quotient::Room::aliases ( ) const

Get a list of both canonical and alternative aliases.

◆ allHistoryLoaded()

bool Quotient::Room::allHistoryLoaded ( ) const

Check whether all historical messages are already loaded

Returns
true if the "oldest" event in the timeline is a room creation event and there's no further history to load; false otherwise

◆ allHistoryLoadedChanged

void Quotient::Room::allHistoryLoadedChanged ( )
signal

◆ allMembersLoaded

void Quotient::Room::allMembersLoaded ( )
signal

The previously lazy-loaded members list is now loaded entirely

See also
setDisplayed

◆ altAliases()

QStringList Quotient::Room::altAliases ( ) const

◆ answerCall

void Quotient::Room::answerCall ( const QString &  callId,
const QString &  sdp 
)
slot

◆ avatar() [1/2]

Q_INVOKABLE QImage Quotient::Room::avatar ( int  dimension)

Returns a square room avatar with the given size and requests it from the network if needed

Returns
a pixmap with the avatar or a placeholder if there's none available yet

◆ avatar() [2/2]

Q_INVOKABLE QImage Quotient::Room::avatar ( int  width,
int  height 
)

Returns a room avatar with the given dimensions and requests it from the network if needed

Returns
a pixmap with the avatar or a placeholder if there's none available yet

◆ avatarChanged

void Quotient::Room::avatarChanged ( )
signal

◆ avatarMediaId()

QString Quotient::Room::avatarMediaId ( ) const

◆ avatarObject()

const Avatar& Quotient::Room::avatarObject ( ) const

◆ avatarUrl()

QUrl Quotient::Room::avatarUrl ( ) const

◆ ban

void Quotient::Room::ban ( const QString &  userId,
const QString &  reason = {} 
)
slot

◆ baseStateLoaded

void Quotient::Room::baseStateLoaded ( )
signal

Initial set of state events has been loaded.

The initial set is what comes from the initial sync for the room. This includes all basic things like RoomCreateEvent, RoomNameEvent, a (lazy-loaded, not full) set of RoomMemberEvents etc. This is a per-room reflection of Connection::loadedRoomState

See also
Connection::loadedRoomState

◆ beforeDestruction

void Quotient::Room::beforeDestruction ( Quotient::Room )
signal

The room is about to be deleted.

◆ callEvent

void Quotient::Room::callEvent ( Quotient::Room room,
const Quotient::RoomEvent event 
)
signal

◆ cancelFileTransfer

void Quotient::Room::cancelFileTransfer ( const QString &  id)
slot

◆ canonicalAlias()

QString Quotient::Room::canonicalAlias ( ) const

◆ canSwitchVersions()

Q_INVOKABLE bool Quotient::Room::canSwitchVersions ( ) const

Whether the current user is allowed to upgrade the room.

◆ changed

void Quotient::Room::changed ( Quotient::Room::Changes  changes)
signal

A common signal for various kinds of changes in the room Aside from all changes in the room state

Parameters
changesa set of flags describing what changes occurred upon the last sync
See also
Changes

◆ checkForNotifications()

virtual Notification Quotient::Room::checkForNotifications ( const TimelineItem ti)
protectedvirtual

◆ checkVersion

void Quotient::Room::checkVersion ( )
slot

Check whether the room should be upgraded

◆ connection()

Connection* Quotient::Room::connection ( ) const

◆ creation()

const RoomCreateEvent* Quotient::Room::creation ( ) const

◆ currentState()

RoomStateView Quotient::Room::currentState ( ) const

Get the current room state.

◆ decryptMessage()

RoomEventPtr Quotient::Room::decryptMessage ( const EncryptedEvent encryptedEvent)

◆ directChatMembers()

QList<RoomMember> Quotient::Room::directChatMembers ( ) const

Get the list of members this room is a direct chat with.

◆ discardMessage

void Quotient::Room::discardMessage ( const QString &  txnId)
slot

◆ displayed()

bool Quotient::Room::displayed ( ) const

◆ displayedChanged

void Quotient::Room::displayedChanged ( bool  displayed)
signal

◆ displayName()

QString Quotient::Room::displayName ( ) const

◆ displaynameAboutToChange

void Quotient::Room::displaynameAboutToChange ( Quotient::Room room)
signal

◆ displaynameChanged

void Quotient::Room::displaynameChanged ( Quotient::Room room,
QString  oldName 
)
signal

◆ displayNameForHtml()

QString Quotient::Room::displayNameForHtml ( ) const

◆ downloadFile

void Quotient::Room::downloadFile ( const QString &  eventId,
const QUrl &  localFilename = {} 
)
slot

◆ encryption

void Quotient::Room::encryption ( )
signal

◆ eventsHistoryJob()

GetRoomEventsJob* Quotient::Room::eventsHistoryJob ( ) const

◆ eventsHistoryJobChanged

void Quotient::Room::eventsHistoryJobChanged ( )
signal

◆ exportMegolmSessions()

QJsonArray Quotient::Room::exportMegolmSessions ( )

◆ fileNameToDownload()

Q_INVOKABLE QString Quotient::Room::fileNameToDownload ( const QString &  eventId) const

Get a file name for downloading for a given event id.

The event MUST be RoomMessageEvent and have content for downloading.

See also
RoomMessageEvent::hasContent

◆ fileSource()

Q_INVOKABLE QUrl Quotient::Room::fileSource ( const QString &  id) const

Get the URL to the actual file source in a unified way.

For uploads it will return a URL to a local file; for downloads the URL will be taken from the corresponding room event.

◆ fileTransferCompleted

void Quotient::Room::fileTransferCompleted ( QString  id,
QUrl  localFile,
FileSourceInfo  fileMetadata 
)
signal

◆ fileTransferFailed

void Quotient::Room::fileTransferFailed ( QString  id,
QString  errorMessage = {} 
)
signal

◆ fileTransferInfo()

Q_INVOKABLE Quotient::FileTransferInfo Quotient::Room::fileTransferInfo ( const QString &  id) const

Get information on file upload/download.

Parameters
iduploads are identified by the corresponding event's transactionId (because uploads are done before the event is even sent), while downloads are using the normal event id for identifier.

◆ fileTransferProgress

void Quotient::Room::fileTransferProgress ( QString  id,
qint64  progress,
qint64  total 
)
signal

◆ findInTimeline() [1/2]

rev_iter_t Quotient::Room::findInTimeline ( const QString &  evtId) const

◆ findInTimeline() [2/2]

rev_iter_t Quotient::Room::findInTimeline ( TimelineItem::index_t  index) const

◆ findPendingEvent() [1/2]

PendingEvents::iterator Quotient::Room::findPendingEvent ( const QString &  txnId)

◆ findPendingEvent() [2/2]

PendingEvents::const_iterator Quotient::Room::findPendingEvent ( const QString &  txnId) const

◆ firstDisplayedEventChanged

void Quotient::Room::firstDisplayedEventChanged ( )
signal

◆ firstDisplayedEventId()

QString Quotient::Room::firstDisplayedEventId ( ) const

◆ firstDisplayedMarker()

rev_iter_t Quotient::Room::firstDisplayedMarker ( ) const

◆ fullyReadMarker()

rev_iter_t Quotient::Room::fullyReadMarker ( ) const

Get the iterator to the latest timeline item marked as fully read.

This method calls findInTimeline on the result of lastFullyReadEventId. If the fully read marker turns out to be outside the timeline (because the event marked as fully read is too far back in the history) the returned value will be equal to historyEdge.

Be sure to read the caveats on iterators returned by findInTimeline.

See also
lastFullyReadEventId, findInTimeline

◆ fullyReadMarkerMoved

void Quotient::Room::fullyReadMarkerMoved ( QString  fromEventId,
QString  toEventId 
)
signal

◆ getPreviousContent

JobHandle<GetRoomEventsJob> Quotient::Room::getPreviousContent ( int  limit = 10,
const QString &  filter = {} 
)
slot

◆ handleRoomKeyEvent()

void Quotient::Room::handleRoomKeyEvent ( const RoomKeyEvent roomKeyEvent,
const QString &  senderId,
const QByteArray &  olmSessionId,
const QByteArray &  senderKey,
const QByteArray &  senderEdKey 
)

◆ hangupCall

void Quotient::Room::hangupCall ( const QString &  callId)
slot

◆ hasAccountData()

bool Quotient::Room::hasAccountData ( const QString &  type) const

Check whether the room has account data of the given type Tags and read markers are not supported by this method yet.

◆ highlightCount()

qsizetype Quotient::Room::highlightCount ( ) const

Get the number of highlights since the last read receipt.

As of 0.7, this is defined by the homeserver as Quotient doesn't process push rules.

See also
unreadStats, lastLocalReadReceipt

◆ highlightCountChanged

void Quotient::Room::highlightCountChanged ( )
signal
See also
highlightCount

◆ historyEdge()

rev_iter_t Quotient::Room::historyEdge ( ) const

Get a reverse iterator at the position before the "oldest" event.

Same as messageEvents().crend()

◆ id()

const QString& Quotient::Room::id ( ) const

◆ inviteCall

void Quotient::Room::inviteCall ( const QString &  callId,
const int  lifetime,
const QString &  sdp 
)
slot

◆ invitedCount()

int Quotient::Room::invitedCount ( ) const

◆ inviteToRoom

void Quotient::Room::inviteToRoom ( const QString &  memberId)
slot

◆ isDirectChat()

Q_INVOKABLE bool Quotient::Room::isDirectChat ( ) const

Check whether this room is a direct chat.

◆ isEventNotable()

virtual bool Quotient::Room::isEventNotable ( const TimelineItem ti) const
virtual

Determine whether an event should be counted as unread.

The criteria of including an event in unread counters are described in MSC2654; according to these, the event should be counted as unread (or, in libQuotient parlance, is "notable") if it is:

  • either
    • a message event that is not m.notice, or
    • a state event with type being one of: m.room.topic, m.room.name, m.room.avatar, m.room.tombstone;
  • neither redacted, nor an edit (redactions cause the redacted event to stop being notable, while edits are not notable themselves while the original event usually is);
  • from a non-local user (events from other devices of the local user are not notable).
    See also
    partiallyReadStats, unreadStats

◆ isFavourite()

bool Quotient::Room::isFavourite ( ) const

Check whether the list of tags has m.favourite.

◆ isLowPriority()

bool Quotient::Room::isLowPriority ( ) const

Check whether the list of tags has m.lowpriority.

◆ isMember()

Q_INVOKABLE bool Quotient::Room::isMember ( const QString &  userId) const

Check whether a user with the given id is a member of the room.

◆ isServerNoticeRoom()

bool Quotient::Room::isServerNoticeRoom ( ) const

Check whether this room is for server notices (MSC1452)

◆ isUnstable()

bool Quotient::Room::isUnstable ( ) const

◆ isValidIndex()

Q_INVOKABLE bool Quotient::Room::isValidIndex ( Quotient::TimelineItem::index_t  timelineIndex) const

◆ joinedCount()

int Quotient::Room::joinedCount ( ) const

◆ joinedMemberIds()

QStringList Quotient::Room::joinedMemberIds ( ) const

Get a list of room member Matrix IDs who have joined the room.

◆ joinedMembers()

QList<RoomMember> Quotient::Room::joinedMembers ( ) const

Get a list of room members who have joined the room.

◆ joinState()

Q_INVOKABLE JoinState Quotient::Room::joinState ( ) const

◆ joinStateChanged

void Quotient::Room::joinStateChanged ( Quotient::JoinState  oldState,
Quotient::JoinState  newState 
)
signal

◆ kickMember

void Quotient::Room::kickMember ( const QString &  memberId,
const QString &  reason = {} 
)
slot

◆ lastDisplayedEventChanged

void Quotient::Room::lastDisplayedEventChanged ( )
signal

◆ lastDisplayedEventId()

QString Quotient::Room::lastDisplayedEventId ( ) const

◆ lastDisplayedMarker()

rev_iter_t Quotient::Room::lastDisplayedMarker ( ) const

◆ lastFullyReadEventId()

QString Quotient::Room::lastFullyReadEventId ( ) const

Get the latest event id marked as fully read.

This can be either the event id pointed to by the actual latest m.fully_read event, or the latest event id marked locally as fully read if markMessagesAsRead or markAllMessagesAsRead has been called and the homeserver didn't return an updated m.fully_read event yet.

See also
markMessagesAsRead, markAllMessagesAsRead, fullyReadMarker

◆ lastLocalReadReceipt()

ReadReceipt Quotient::Room::lastLocalReadReceipt ( ) const

Get the latest read receipt from the local user.

This is a shortcut for lastReadReceipt(localUserId).

See also
lastReadReceipt

◆ lastReadEventChanged

void Quotient::Room::lastReadEventChanged ( QVector< QString >  userIds)
signal

The event the m.read receipt points to has changed for the listed users

See also
lastReadReceipt

◆ lastReadReceipt()

ReadReceipt Quotient::Room::lastReadReceipt ( const QString &  userId) const

Get the latest read receipt from a user.

The user id must be valid. A read receipt with an empty event id is returned if the user id is valid but there was no read receipt from them.

See also
usersAtEventId

◆ leaveRoom

JobHandle<LeaveRoomJob> Quotient::Room::leaveRoom ( )
slot

◆ localMember()

RoomMember Quotient::Room::localMember ( ) const

Get a RoomMember object for the local user.

◆ localReadReceiptMarker()

rev_iter_t Quotient::Room::localReadReceiptMarker ( ) const

Find the timeline item the local read receipt is at.

This is a shortcut for

room->findInTimeline(room->lastLocalReadReceipt().eventId);

◆ makeMediaUrl()

Q_INVOKABLE QUrl Quotient::Room::makeMediaUrl ( const QString &  eventId,
const QUrl &  mxcUrl 
) const

◆ markAllMessagesAsRead

void Quotient::Room::markAllMessagesAsRead ( )
slot

Put the fully-read marker at the latest message in the room.

◆ markMessagesAsRead()

Q_INVOKABLE void Quotient::Room::markMessagesAsRead ( const QString &  uptoEventId)

Mark the event with uptoEventId as fully read.

Marks the event with the specified id as fully read locally and also sends an update to m.fully_read account data to the server either for this message or, if it's from the local user, for the nearest non-local message before. uptoEventId must point to a known event in the timeline; the method will do nothing if the event is behind the current m.fully_read marker or is not loaded, to prevent accidentally trying to move the marker back in the timeline.

See also
markAllMessagesAsRead, fullyReadMarker

◆ maxTimelineIndex()

Q_INVOKABLE Quotient::TimelineItem::index_t Quotient::Room::maxTimelineIndex ( ) const

◆ member()

Q_INVOKABLE RoomMember Quotient::Room::member ( const QString &  userId) const

Get a RoomMember object for the given user Matrix ID.

Will return a nullptr if there is no m.room.member event for the user in the room so needs to be null checked.

Note
This can return a member in any state that is known to the room so check the state (using RoomMember::membershipState()) before use.

◆ memberAvatar() [1/2]

Q_INVOKABLE QImage Quotient::Room::memberAvatar ( const QString &  memberId,
int  dimension 
)

Get a square avatar of the specified size.

This is an overload for the case when the needed width and height are equal.

◆ memberAvatar() [2/2]

Q_INVOKABLE QImage Quotient::Room::memberAvatar ( const QString &  memberId,
int  width,
int  height 
)

Get a avatar of the specified dimensions.

This always returns immediately; if there's no avatar cached yet, the call triggers a network request, that will emit Room::memberAvatarUpdated() once completed.

Returns
a pixmap with the avatar or a placeholder if there's none available yet

◆ memberAvatarObject()

const Avatar& Quotient::Room::memberAvatarObject ( const QString &  memberId) const

◆ memberAvatarUpdated

void Quotient::Room::memberAvatarUpdated ( RoomMember  member)
signal

A known joined member has updated their avatar.

◆ memberEffectivePowerLevel()

Q_INVOKABLE int Quotient::Room::memberEffectivePowerLevel ( const QString &  memberId = {}) const

The effective power level of the given member in the room.

This is normally the same as calling RoomPowerLevelEvent::powerLevelForUser(userId) but takes into account the room context and works even if the room state has no power levels event. It is THE recommended way to get a room member's power level to display in the UI.

Parameters
memberIdThe room member ID to check; if empty, the local user will be checked
See also
RoomPowerLevelsEvent, https://spec.matrix.org/v1.11/client-server-api/#mroompower_levels

◆ memberIds()

QStringList Quotient::Room::memberIds ( ) const

Get a list of all member Matrix IDs known to the room.

◆ memberJoined

void Quotient::Room::memberJoined ( RoomMember  member)
signal

A new member has joined the room.

This can be from any previous state or a member previously unknown to the room.

◆ memberLeft

void Quotient::Room::memberLeft ( RoomMember  member)
signal

A member who previously joined has left.

The member will still be known to the room their membership state has changed from Membership::Join to anything else.

◆ memberListChanged

void Quotient::Room::memberListChanged ( )
signal

The list of members has changed.

Emitted no more than once per sync, this is a good signal to for cases when some action should be done upon any change in the member list. If you need per-item granularity you should use userAdded, userRemoved and memberAboutToRename / memberRenamed instead.

◆ memberNameAboutToUpdate

void Quotient::Room::memberNameAboutToUpdate ( RoomMember  member,
QString  newName 
)
signal

A known joined member is about to update their display name.

◆ memberNameUpdated

void Quotient::Room::memberNameUpdated ( RoomMember  member)
signal

A known joined member has updated their display name.

◆ members()

QList<RoomMember> Quotient::Room::members ( ) const

Get a list of all members known to the room.

◆ membersLeft()

QList<RoomMember> Quotient::Room::membersLeft ( ) const

Get a list of all members known to have left the room.

◆ memberSorter()

MemberSorter Quotient::Room::memberSorter ( ) const

◆ memberState()

Q_INVOKABLE Quotient::Membership Quotient::Room::memberState ( const QString &  userId) const

Check the join state of a given user in this room.

Returns
the given user's state with respect to the room

◆ membersTyping()

QList<RoomMember> Quotient::Room::membersTyping ( ) const

Get a list of room members who are currently sending a typing indicator.

◆ messageEvents()

const Timeline& Quotient::Room::messageEvents ( ) const

◆ messageSent

void Quotient::Room::messageSent ( QString  txnId,
QString  eventId 
)
signal

The server accepted the message.

This is emitted when an event sending request has successfully completed. This does not mean that the event is already in the local timeline, only that the server has accepted it.

Parameters
txnIdtransaction id assigned by the client during sending
eventIdevent id assigned by the server upon acceptance
See also
postEvent, postPlainText, postMessage, postHtmlMessage
pendingEventMerged, aboutToAddNewMessages

◆ minTimelineIndex()

Q_INVOKABLE Quotient::TimelineItem::index_t Quotient::Room::minTimelineIndex ( ) const

◆ name()

QString Quotient::Room::name ( ) const

◆ namesChanged

void Quotient::Room::namesChanged ( Quotient::Room room)
signal

The room name, the canonical alias or other aliases changed.

Not triggered when display name changes.

◆ needsDisambiguation()

bool Quotient::Room::needsDisambiguation ( const QString &  userId) const

Whether the name for the given member should be disambiguated.

◆ newFileTransfer

void Quotient::Room::newFileTransfer ( QString  id,
QUrl  localFile 
)
signal

◆ notificationCount()

qsizetype Quotient::Room::notificationCount ( ) const

Get the number of notifications since the last read receipt.

This is the same as unreadStats().notableCount.

See also
unreadStats, lastLocalReadReceipt

◆ notificationCountChanged

void Quotient::Room::notificationCountChanged ( )
signal

◆ notificationFor()

Notification Quotient::Room::notificationFor ( const TimelineItem ti) const

Get notification details for an event.

This allows to get details on the kind of notification that should generated for evt.

◆ onAddHistoricalTimelineEvents()

virtual void Quotient::Room::onAddHistoricalTimelineEvents ( rev_iter_t  )
inlineprotectedvirtual

Definition at line 977 of file room.h.

◆ onAddNewTimelineEvents()

virtual void Quotient::Room::onAddNewTimelineEvents ( timeline_iter_t  )
inlineprotectedvirtual

Definition at line 976 of file room.h.

◆ onRedaction()

virtual void Quotient::Room::onRedaction ( const RoomEvent ,
const RoomEvent  
)
inlineprotectedvirtual

Definition at line 978 of file room.h.

◆ otherMembersTyping()

QList<RoomMember> Quotient::Room::otherMembersTyping ( ) const

Get a list of room members who are currently sending a typing indicator.

The local member is excluded from this list.

◆ partiallyReadStats()

EventStats Quotient::Room::partiallyReadStats ( ) const

Get event statistics since the fully read marker.

This call returns a structure containing:

  • the number of notable unread events since the fully read marker; depending on the fully read marker state with respect to the local timeline, this number may be either exact or estimated (see EventStats::isEstimate);
  • the number of highlights (TODO).

Note that this is different from the unread count defined by MSC2654 and from the notification/highlight numbers defined by the spec in that it counts events since the fully read marker, not since the last read receipt position.

As E2EE is not supported in the library, the returned result will always be an estimate (isEstimate == true) for encrypted rooms; moreover, since the library doesn't know how to tackle push rules yet the number of highlights returned here will always be zero (there's no good substitute for that now).

See also
isEventNotable, fullyReadMarker, unreadStats, EventStats

◆ partiallyReadStatsChanged

void Quotient::Room::partiallyReadStatsChanged ( )
signal

◆ pendingEventAboutToAdd

void Quotient::Room::pendingEventAboutToAdd ( Quotient::RoomEvent event)
signal

The event is about to be appended to the list of pending events.

◆ pendingEventAboutToDiscard

void Quotient::Room::pendingEventAboutToDiscard ( int  pendingEventIndex)
signal

An event will be removed from the list of pending events.

◆ pendingEventAboutToMerge

void Quotient::Room::pendingEventAboutToMerge ( Quotient::RoomEvent serverEvent,
int  pendingEventIndex 
)
signal

The remote echo has arrived with the sync and will be merged with its local counterpart NB: Requires a sync loop to be emitted

◆ pendingEventAdded

void Quotient::Room::pendingEventAdded ( const Quotient::RoomEvent event)
signal

An event has been appended to the list of pending events.

◆ pendingEventChanged

void Quotient::Room::pendingEventChanged ( int  pendingEventIndex)
signal

The status of a pending event has changed.

See also
PendingEventItem::deliveryStatus

◆ pendingEventDiscarded

void Quotient::Room::pendingEventDiscarded ( )
signal

An event has just been removed from the list of pending events.

◆ pendingEventMerged

void Quotient::Room::pendingEventMerged ( )
signal

The remote and local copies of the event have been merged.

NB: Requires a sync loop to be emitted

◆ pendingEvents()

const PendingEvents& Quotient::Room::pendingEvents ( ) const

◆ pinnedEventIds()

QStringList Quotient::Room::pinnedEventIds ( ) const

◆ pinnedEvents()

QVector<const RoomEvent*> Quotient::Room::pinnedEvents ( ) const

◆ pinnedEventsChanged

void Quotient::Room::pinnedEventsChanged ( )
signal

◆ post() [1/2]

template<typename EvT , typename... ArgTs>
const PendingEventItem& Quotient::Room::post ( ArgTs &&...  args)
inline

Definition at line 719 of file room.h.

◆ post() [2/2]

const PendingEventItem& Quotient::Room::post ( RoomEventPtr  event)

Post a pre-created room message event.

Takes ownership of the event, deleting it once the matching one arrives with the sync.

Note
Do not assume that the event is already on the road to the homeserver when this (or any other post*) method returns; it can be queued internally.
See also
PendingEventItem::deliveryStatus()
Returns
a reference to the pending event item

◆ postEvent

QString Quotient::Room::postEvent ( RoomEvent event)
slot

Post a pre-created room message event

Takes ownership of the event, deleting it once the matching one arrives with the sync

Returns
transaction id associated with the event.

◆ postFile()

QString Quotient::Room::postFile ( const QString &  plainText,
std::unique_ptr< EventContent::FileContentBase fileContent 
)

◆ postHtmlMessage

QString Quotient::Room::postHtmlMessage ( const QString &  plainText,
const QString &  html,
MessageEventType  type = MessageEventType::Text 
)
slot

◆ postHtmlText

QString Quotient::Room::postHtmlText ( const QString &  plainText,
const QString &  html 
)
slot

◆ postJson

QString Quotient::Room::postJson ( const QString &  matrixType,
const QJsonObject &  eventContent 
)
slot

◆ postMessage

QString Quotient::Room::postMessage ( const QString &  plainText,
MessageEventType  type 
)
slot

◆ postPlainText

QString Quotient::Room::postPlainText ( const QString &  plainText)
slot

◆ postReaction

QString Quotient::Room::postReaction ( const QString &  eventId,
const QString &  key 
)
slot

Send a reaction on a given event with a given key.

◆ powerLevelFor() [1/2]

template<EventClass EvT>
int Quotient::Room::powerLevelFor ( ) const
inline

Get the power level required to send events of the given type.

This is an optimised version of non-template powerLevelFor() (with the same caveat about operations based on some event types) for cases when the event type is known at build time.

Template Parameters
EvTthe event type to get the power level for

Definition at line 704 of file room.h.

◆ powerLevelFor() [2/2]

Q_INVOKABLE int Quotient::Room::powerLevelFor ( const QString &  eventTypeId,
bool  forceStateEvent = false 
) const

Get the power level required to send events of the given type.

Note
This is a generic method that only gets the power level to send events with a given type. Some operations have additional restrictions or enablers though: e.g., room member changes (kicks, invites) have special power levels; on the other hand, redactions of one's own messages are allowed regardless of the power level. To check effective ability to perform an operation, use Room's can*() methods instead of comparing the power levels (those are also slightly more efficient).
Unlike the template version below, this method determines at runtime whether an event type is that of a state event, assuming unknown event types to be non-state; pass true as the second parameter to override that.
See also
canSend, canRedact, canSwitchVersions

◆ predecessor()

Room* Quotient::Room::predecessor ( JoinStates  statesFilter = JoinState::Invite|JoinState::Join) const

Room predecessor.

This function validates that the predecessor has a tombstone and the tombstone refers to the current room. If that's not the case, or if the predecessor is in a join state not matching stateFilter, the function returns nullptr.

◆ predecessorId()

QString Quotient::Room::predecessorId ( ) const

◆ prettyPrint()

Q_INVOKABLE QString Quotient::Room::prettyPrint ( const QString &  plainText) const

Pretty-prints plain text into HTML As of now, it's exactly the same as Quotient::prettyPrint(); in the future, it will also linkify room aliases, mxids etc. using the room context.

◆ processAccountDataEvent()

virtual Changes Quotient::Room::processAccountDataEvent ( EventPtr &&  event)
protectedvirtual

◆ processEphemeralEvent()

virtual Changes Quotient::Room::processEphemeralEvent ( EventPtr &&  event)
protectedvirtual

◆ processStateEvent()

virtual Changes Quotient::Room::processStateEvent ( const RoomEvent e)
protectedvirtual

◆ redactEvent

void Quotient::Room::redactEvent ( const QString &  eventId,
const QString &  reason = {} 
)
slot

◆ refreshDisplayName

void Quotient::Room::refreshDisplayName ( )
slot

You shouldn't normally call this method; it's here for debugging.

◆ relatedEvents() [1/2]

const RelatedEvents Quotient::Room::relatedEvents ( const QString &  evtId,
EventRelation::reltypeid_t  relType 
) const

◆ relatedEvents() [2/2]

const RelatedEvents Quotient::Room::relatedEvents ( const RoomEvent evt,
EventRelation::reltypeid_t  relType 
) const

◆ removeTag()

Q_INVOKABLE void Quotient::Room::removeTag ( const QString &  name)

Remove a tag from the room.

◆ replacedEvent

void Quotient::Room::replacedEvent ( const Quotient::RoomEvent newEvent,
const Quotient::RoomEvent oldEvent 
)
signal

◆ requestedHistorySize()

int Quotient::Room::requestedHistorySize ( ) const

Get the number of requested historical events.

Returns
The number of requested events if there's a pending request; 0 otherwise

◆ retryMessage

QString Quotient::Room::retryMessage ( const QString &  txnId)
slot

◆ sendCallCandidates

void Quotient::Room::sendCallCandidates ( const QString &  callId,
const QJsonArray &  candidates 
)
slot

◆ setCanonicalAlias

void Quotient::Room::setCanonicalAlias ( const QString &  newAlias)
slot

◆ setDisplayed()

void Quotient::Room::setDisplayed ( bool  displayed = true)

Mark the room as currently displayed to the user.

Marking the room displayed causes the room to obtain the full list of members if it's been lazy-loaded before; in the future it may do more things bound to "screen time" of the room, e.g. measure that "screen time".

◆ setFirstDisplayedEvent()

void Quotient::Room::setFirstDisplayedEvent ( TimelineItem::index_t  index)

◆ setFirstDisplayedEventId()

void Quotient::Room::setFirstDisplayedEventId ( const QString &  eventId)

◆ setLastDisplayedEvent()

void Quotient::Room::setLastDisplayedEvent ( TimelineItem::index_t  index)

◆ setLastDisplayedEventId()

void Quotient::Room::setLastDisplayedEventId ( const QString &  eventId)

◆ setLocalAliases

void Quotient::Room::setLocalAliases ( const QStringList aliases)
slot

Set room aliases on the user's current server.

◆ setName

void Quotient::Room::setName ( const QString &  newName)
slot

◆ setPinnedEvents

void Quotient::Room::setPinnedEvents ( const QStringList events)
slot

◆ setReadReceipt

void Quotient::Room::setReadReceipt ( const QString &  atEventId)
slot

Set a given event as last read and post a read receipt on it.

Does nothing if the event is behind the current read receipt.

See also
lastReadReceipt, markMessagesAsRead, markAllMessagesAsRead

◆ setState() [1/3]

template<typename EvT , typename... ArgTs>
auto Quotient::Room::setState ( ArgTs &&...  args)
inline

Set a state event of the given type with the given arguments.

This type-safe overload attempts to send a state event of the type EvT constructed from args.

Definition at line 737 of file room.h.

◆ setState [2/3]

SetRoomStateWithKeyJob* Quotient::Room::setState ( const QString &  evtType,
const QString &  stateKey,
const QJsonObject &  contentJson 
)
slot

Send a request to update the room state based on freeform inputs.

◆ setState() [3/3]

SetRoomStateWithKeyJob* Quotient::Room::setState ( const StateEvent evt)

Send a request to update the room state with the given event.

◆ setTags()

void Quotient::Room::setTags ( TagsMap  newTags,
ActionScope  applyOn = ThisRoomOnly 
)

Overwrite the room's tags This completely replaces the existing room's tags with a set of new ones and updates the new set on the server. Unlike most other methods in Room, this one sends a signal about changes immediately, not waiting for confirmation from the server (because tags are saved in account data rather than in shared room state).

Parameters
applyOnsetting this to Room::OnAllConversations will set tags on this and all known predecessors and successors; by default only the current room is changed

◆ setTopic

void Quotient::Room::setTopic ( const QString &  newTopic)
slot

◆ stabilityUpdated

void Quotient::Room::stabilityUpdated ( QString  recommendedDefault,
QStringList  stableVersions 
)
signal

The room's version stability may have changed.

◆ startVerification()

Q_INVOKABLE void Quotient::Room::startVerification ( )

◆ successor()

Room* Quotient::Room::successor ( JoinStates  statesFilter = JoinState::Invite|JoinState::Join) const

Room successor.

This function validates that the successor room's creation event refers to the current room. If that's not the case, or if the successor is in a join state not matching stateFilter, it returns nullptr.

◆ successorId()

QString Quotient::Room::successorId ( ) const

◆ supportsCalls()

Q_INVOKABLE bool Quotient::Room::supportsCalls ( ) const

◆ switchVersion

void Quotient::Room::switchVersion ( QString  newVersion)
slot

Switch the room's version (aka upgrade)

◆ syncEdge()

Timeline::const_iterator Quotient::Room::syncEdge ( ) const

Get an iterator for the position beyond the latest arrived event.

Same as messageEvents().cend()

◆ tag()

Tag Quotient::Room::tag ( const QString &  name) const

◆ tagNames()

QStringList Quotient::Room::tagNames ( ) const

◆ tags()

TagsMap Quotient::Room::tags ( ) const

◆ tagsAboutToChange

void Quotient::Room::tagsAboutToChange ( )
signal

◆ tagsChanged

void Quotient::Room::tagsChanged ( )
signal

◆ timelineSize()

int Quotient::Room::timelineSize ( ) const

◆ toJson()

virtual QJsonObject Quotient::Room::toJson ( ) const
protectedvirtual

◆ tombstone()

const RoomTombstoneEvent* Quotient::Room::tombstone ( ) const

◆ topic()

QString Quotient::Room::topic ( ) const

◆ topicChanged

void Quotient::Room::topicChanged ( )
signal

◆ totalMemberCount()

int Quotient::Room::totalMemberCount ( ) const

◆ typingChanged

void Quotient::Room::typingChanged ( )
signal

The list of members sending typing indicators has changed.

◆ unban

void Quotient::Room::unban ( const QString &  userId)
slot

◆ unreadStats()

EventStats Quotient::Room::unreadStats ( ) const

Get event statistics since the last read receipt.

This call returns a structure that contains the following three numbers, all counted on the timeline segment between the event pointed to by the m.fully_read marker and the sync edge:

  • the number of unread events - depending on the read receipt state with respect to the local timeline, this number may be either precise or estimated (see EventStats::isEstimate);
  • the number of highlights (TODO).

As E2EE is not supported in the library, the returned result will always be an estimate (isEstimate == true) for encrypted rooms; moreover, since the library doesn't know how to tackle push rules yet the number of highlights returned here will always be zero - use highlightCount() for now.

See also
isEventNotable, lastLocalReadReceipt, partiallyReadStats, highlightCount

◆ unreadStatsChanged

void Quotient::Room::unreadStatsChanged ( )
signal

◆ updateData()

virtual void Quotient::Room::updateData ( SyncRoomData &&  data,
bool  fromCache = false 
)
protectedvirtual

◆ updatedEvent

void Quotient::Room::updatedEvent ( QString  eventId)
signal

◆ upgraded

void Quotient::Room::upgraded ( QString  serverMessage,
Quotient::Room successor 
)
signal

This room has been upgraded and won't receive updates any more.

◆ upgradeFailed

void Quotient::Room::upgradeFailed ( QString  errorMessage)
signal

An attempted room upgrade has failed.

◆ uploadFile

void Quotient::Room::uploadFile ( const QString &  id,
const QUrl &  localFilename,
const QString &  overrideContentType = {} 
)
slot

◆ urlToDownload()

Q_INVOKABLE QUrl Quotient::Room::urlToDownload ( const QString &  eventId) const

◆ urlToThumbnail()

Q_INVOKABLE QUrl Quotient::Room::urlToThumbnail ( const QString &  eventId) const

◆ userIdsAtEvent()

QSet<QString> Quotient::Room::userIdsAtEvent ( const QString &  eventId) const

Get users whose latest read receipts point to the event.

This method is for cases when you need to show users who have read an event. Calling it on inexistent or empty event id will return an empty set.

Note
The returned list may contain ids resolving to users that are not loaded as room members yet (in particular, if members are not yet lazy-loaded). For now this merely means that the user's room-specific name and avatar will not be there; but generally it's recommended to ensure that all room members are loaded before operating on the result of this function.
See also
lastReadReceipt, allMembersLoaded

◆ usesEncryption()

bool Quotient::Room::usesEncryption ( ) const

◆ version()

QString Quotient::Room::version ( ) const

◆ whenMessageMerged()

PendingEventItem::future_type Quotient::Room::whenMessageMerged ( QString  txnId) const

Friends And Related Function Documentation

◆ Connection

friend class Connection
friend

Definition at line 986 of file room.h.

Property Documentation

◆ accountDataEventTypes

QStringList Quotient::Room::accountDataEventTypes
read

Definition at line 113 of file room.h.

◆ aliases

QStringList Quotient::Room::aliases
read

Definition at line 113 of file room.h.

◆ allHistoryLoaded

bool Quotient::Room::allHistoryLoaded
read

Definition at line 113 of file room.h.

◆ altAliases

QStringList Quotient::Room::altAliases
read

Definition at line 113 of file room.h.

◆ avatarMediaId

QString Quotient::Room::avatarMediaId
read

Definition at line 113 of file room.h.

◆ avatarUrl

QUrl Quotient::Room::avatarUrl
read

Definition at line 113 of file room.h.

◆ canonicalAlias

QString Quotient::Room::canonicalAlias
read

Definition at line 113 of file room.h.

◆ connection

Connection* Quotient::Room::connection
read

Definition at line 113 of file room.h.

◆ displayed

bool Quotient::Room::displayed
readwrite

Definition at line 113 of file room.h.

◆ displayName

QString Quotient::Room::displayName
read

Definition at line 113 of file room.h.

◆ displayNameForHtml

QString Quotient::Room::displayNameForHtml
read

Definition at line 113 of file room.h.

◆ eventsHistoryJob

GetRoomEventsJob* Quotient::Room::eventsHistoryJob
read

Definition at line 113 of file room.h.

◆ firstDisplayedEventId

QString Quotient::Room::firstDisplayedEventId
read

Definition at line 113 of file room.h.

◆ highlightCount

qsizetype Quotient::Room::highlightCount
read

Definition at line 113 of file room.h.

◆ id

QString Quotient::Room::id
read

Definition at line 113 of file room.h.

◆ invitedCount

int Quotient::Room::invitedCount
read

Definition at line 113 of file room.h.

◆ isFavourite

bool Quotient::Room::isFavourite
read

Definition at line 113 of file room.h.

◆ isLowPriority

bool Quotient::Room::isLowPriority
read

Definition at line 113 of file room.h.

◆ isUnstable

bool Quotient::Room::isUnstable
read

Definition at line 113 of file room.h.

◆ joinedCount

int Quotient::Room::joinedCount
read

Definition at line 113 of file room.h.

◆ lastDisplayedEventId

QString Quotient::Room::lastDisplayedEventId
read

Definition at line 113 of file room.h.

◆ lastFullyReadEventId

QString Quotient::Room::lastFullyReadEventId
read

Definition at line 113 of file room.h.

◆ localMember

RoomMember Quotient::Room::localMember
read

Definition at line 113 of file room.h.

◆ localMemberEffectivePowerLevel

int Quotient::Room::localMemberEffectivePowerLevel
read

Definition at line 113 of file room.h.

◆ membersTyping

QList<RoomMember> Quotient::Room::membersTyping
read

Definition at line 113 of file room.h.

◆ name

QString Quotient::Room::name
read

Definition at line 113 of file room.h.

◆ notificationCount

qsizetype Quotient::Room::notificationCount
read

Definition at line 113 of file room.h.

◆ otherMembersTyping

QList<RoomMember> Quotient::Room::otherMembersTyping
read

Definition at line 113 of file room.h.

◆ partiallyReadStats

EventStats Quotient::Room::partiallyReadStats
read

Definition at line 113 of file room.h.

◆ pinnedEventIds

QStringList Quotient::Room::pinnedEventIds
readwrite

Definition at line 113 of file room.h.

◆ predecessorId

QString Quotient::Room::predecessorId
read

Definition at line 113 of file room.h.

◆ requestedHistorySize

int Quotient::Room::requestedHistorySize
read

Definition at line 113 of file room.h.

◆ successorId

QString Quotient::Room::successorId
read

Definition at line 113 of file room.h.

◆ tagNames

QStringList Quotient::Room::tagNames
read

Definition at line 113 of file room.h.

◆ timelineSize

int Quotient::Room::timelineSize
read

Definition at line 113 of file room.h.

◆ topic

QString Quotient::Room::topic
read

Definition at line 113 of file room.h.

◆ totalMemberCount

int Quotient::Room::totalMemberCount
read

Definition at line 113 of file room.h.

◆ unreadStats

EventStats Quotient::Room::unreadStats
read

Definition at line 113 of file room.h.

◆ usesEncryption

bool Quotient::Room::usesEncryption
read

Definition at line 113 of file room.h.

◆ version

QString Quotient::Room::version
read

Definition at line 113 of file room.h.


The documentation for this class was generated from the following file: