Message

Send message

Room::sendMessage(Event msg)

Parameters:

Name
Type
Description
Required

room_id

string

room_id string

true

Text

String

Text

True

Receive message

auto roomId = m[1].str();
auto room = c.room(roomId);

auto msgs = +room.timelineEvents();

std::cout << "Messages in " << roomId << ":\n";
for (auto msg : msgs) {
std::cout << "Event "
<< msg.id() << " from "
<< msg.sender() << " at "
<< msg.originServerTs() << " typed "
<< msg.type() << "\n";
std::cout << msg.content().get().dump();
std::cout << std::endl;
}

Last updated