Add raw access to json structure from event
This commit is contained in:
parent
4f5efa9ba9
commit
500c0eb6ee
@ -31,6 +31,7 @@ namespace matrix::sync{
|
||||
class event
|
||||
{
|
||||
protected:
|
||||
RJP_value* m_event;
|
||||
RJP_value* m_type;
|
||||
RJP_value* m_content;
|
||||
public:
|
||||
@ -43,6 +44,8 @@ namespace matrix::sync{
|
||||
raii::rjp_string type(void)&&;
|
||||
const RJP_value* content(void)const;
|
||||
RJP_value* content(void);
|
||||
const RJP_value* raw(void)const;
|
||||
RJP_value* raw(void);
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -23,6 +23,7 @@ namespace matrix::sync{
|
||||
|
||||
//Event base
|
||||
event::event(RJP_value* ev):
|
||||
m_event(ev),
|
||||
m_type(rjp_search_member(ev, json::keys::event::type(), 0).value),
|
||||
m_content(rjp_search_member(ev, json::keys::event::content(), 0).value){}
|
||||
raii::static_string event::type(void)const&{
|
||||
@ -37,6 +38,12 @@ namespace matrix::sync{
|
||||
RJP_value* event::content(void){
|
||||
return m_content;
|
||||
}
|
||||
const RJP_value* event::raw(void)const{
|
||||
return m_event;
|
||||
}
|
||||
RJP_value* event::raw(void){
|
||||
return m_event;
|
||||
}
|
||||
|
||||
//Room event
|
||||
room_event::room_event(RJP_value* ev, const raii::string_base& roomid):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user