Skip to content

Conversation

TobiasFella
Copy link
Member

No description provided.

Copy link
Member

@KitsuneRal KitsuneRal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I didn't realise it would be so easy to add this.

But should we also change (or even expose for clients) the sync filter to let the presence events in?

namespace Quotient
{

class QUOTIENT_API PresenceEvent : public Quotient::Event {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
class QUOTIENT_API PresenceEvent : public Quotient::Event {
class QUOTIENT_API PresenceEvent : public Event {

// To be implemented
for (const auto &event : presenceData) {
auto presenceEvent = eventCast<const PresenceEvent>(event);
auto sender = presenceEvent->fullJson()[u"sender"_s].toString(); // TODO ?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
auto sender = presenceEvent->fullJson()[u"sender"_s].toString(); // TODO ?
auto sender = presenceEvent->senderId();

Calling it senderId() to align with RoomEvent.

QUO_EVENT(PresenceEvent, "m.presence")

using Event::Event;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
QString senderId() const { return fullJson()[SenderKey].toString(); }

presentUsers.removeAll(sender);
}
}
Q_EMIT q->presenceChanged();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Q_EMIT q->presenceChanged();
emit q->presenceChanged();

@KitsuneRal KitsuneRal added the enhancement A feature or change request for the library label Aug 20, 2025
@TobiasFella
Copy link
Member Author

FWIW, this is still very much a draft, in large parts because i still need to figure out what the various fields in the presence event actually mean; the spec is very unclear here. I also want to change the implementation to store the latest presence event for each user instead and just use that to figure out whether the user is online

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement A feature or change request for the library

Projects

Status: In work

Development

Successfully merging this pull request may close these issues.

2 participants