libkazv
Kazv::Event Class Reference

#include <event.hpp>

Inheritance diagram for Kazv::Event:
Collaboration diagram for Kazv::Event:

Public Types

enum  DecryptionStatus { NotDecrypted , Decrypted }
 

Public Member Functions

 Event ()
 
 Event (JsonWrap j)
 
std::string id () const
 returns the id of this event More...
 
std::string sender () const
 
Timestamp originServerTs () const
 
std::string type () const
 
std::string stateKey () const
 
bool isState () const
 
JsonWrap content () const
 
JsonWrap raw () const
 returns the decrypted json More...
 
JsonWrap originalJson () const
 returns the original json we fetched, probably encrypted. More...
 
JsonWrap decryptedJson () const
 
bool encrypted () const
 
bool decrypted () const
 
Event setDecryptedJson (JsonWrap decryptedJson, DecryptionStatus decrypted) const
 internal. only to be called from inside the client. More...
 
bool redacted () const
 returns whether this event has been redacted. More...
 
std::string replyingTo () const
 Get the event id this event is replying to. More...
 
std::pair< std::string, std::string > relationship () const
 Get the relationship that this event contains. More...
 
JsonWrap mRelatesTo () const
 Get the m.relates_to object in the event. More...
 
template<class Archive >
void serialize (Archive &ar, std::uint32_t const)
 

Static Public Member Functions

static Event fromSync (Event e, std::string roomId)
 

Static Public Attributes

static const JsonWrap notYetDecryptedEvent
 

Member Enumeration Documentation

◆ DecryptionStatus

Enumerator
NotDecrypted 
Decrypted 

Constructor & Destructor Documentation

◆ Event() [1/2]

Kazv::Event::Event ( )

◆ Event() [2/2]

Kazv::Event::Event ( JsonWrap  j)

Member Function Documentation

◆ content()

JsonWrap Kazv::Event::content ( ) const

◆ decrypted()

bool Kazv::Event::decrypted ( ) const

◆ decryptedJson()

JsonWrap Kazv::Event::decryptedJson ( ) const

◆ encrypted()

bool Kazv::Event::encrypted ( ) const

◆ fromSync()

Event Kazv::Event::fromSync ( Event  e,
std::string  roomId 
)
static

◆ id()

std::string Kazv::Event::id ( ) const

returns the id of this event

◆ isState()

bool Kazv::Event::isState ( ) const
Returns
whether this event is a state event. An event is considered a state event if and only if it has a maybe empty stateKey.

◆ mRelatesTo()

JsonWrap Kazv::Event::mRelatesTo ( ) const

Get the m.relates_to object in the event.

Returns
The m.relates_to object of this event.

◆ originalJson()

JsonWrap Kazv::Event::originalJson ( ) const

returns the original json we fetched, probably encrypted.

◆ originServerTs()

Timestamp Kazv::Event::originServerTs ( ) const

◆ raw()

JsonWrap Kazv::Event::raw ( ) const

returns the decrypted json

◆ redacted()

bool Kazv::Event::redacted ( ) const

returns whether this event has been redacted.

◆ relationship()

std::pair< std::string, std::string > Kazv::Event::relationship ( ) const

Get the relationship that this event contains.

Returns
A Pair containing the rel_type and event_id in the m.relates_to section of this event, or a Pair of empty strings if there are not any.

◆ replyingTo()

std::string Kazv::Event::replyingTo ( ) const

Get the event id this event is replying to.

Returns
The event id this event is replying to, or empty string if this event is not a reply.

◆ sender()

std::string Kazv::Event::sender ( ) const

◆ serialize()

template<class Archive >
void Kazv::Event::serialize ( Archive &  ar,
std::uint32_t const   
)
inline

◆ setDecryptedJson()

Event Kazv::Event::setDecryptedJson ( JsonWrap  decryptedJson,
DecryptionStatus  decrypted 
) const

internal. only to be called from inside the client.

◆ stateKey()

std::string Kazv::Event::stateKey ( ) const

◆ type()

std::string Kazv::Event::type ( ) const

Member Data Documentation

◆ notYetDecryptedEvent

const JsonWrap Kazv::Event::notYetDecryptedEvent
static
Initial value:
= {
json{{"type", "m.room.message"},
{"content", {
{"msgtype", "xyz.tusooa.kazv.not.yet.decrypted"},
{"body", "**This message has not yet been decrypted.**"}}}}}
nlohmann::json json
Definition: jsonwrap.hpp:20

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