diff options
Diffstat (limited to 'lib/events/roommemberevent.cpp')
-rw-r--r-- | lib/events/roommemberevent.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/lib/events/roommemberevent.cpp b/lib/events/roommemberevent.cpp index d4b2be45..35cbdb3a 100644 --- a/lib/events/roommemberevent.cpp +++ b/lib/events/roommemberevent.cpp @@ -79,6 +79,12 @@ bool RoomMemberEvent::isInvite() const return membership() == MembershipType::Invite && changesMembership(); } +bool RoomMemberEvent::isRejectedInvite() const +{ + return membership() == MembershipType::Leave && prevContent() + && prevContent()->membership == MembershipType::Invite; +} + bool RoomMemberEvent::isJoin() const { return membership() == MembershipType::Join && changesMembership(); @@ -88,7 +94,19 @@ bool RoomMemberEvent::isLeave() const { return membership() == MembershipType::Leave && prevContent() && prevContent()->membership != membership() - && prevContent()->membership != MembershipType::Ban; + && prevContent()->membership != MembershipType::Ban + && prevContent()->membership != MembershipType::Invite; +} + +bool RoomMemberEvent::isBan() const +{ + return membership() == MembershipType::Ban && changesMembership(); +} + +bool RoomMemberEvent::isUnban() const +{ + return membership() == MembershipType::Leave && prevContent() + && prevContent()->membership == MembershipType::Ban; } bool RoomMemberEvent::isRename() const |