mtxclient icon indicating copy to clipboard operation
mtxclient copied to clipboard

Examples: Getting room names

Open kallisti5 opened this issue 6 months ago • 0 comments

Any chance of an example pulling in room information like it's name? The API isn't exactly easy to use / understand with the mixed layers of abstraction (I think some of this the complexities of Matrix). There also doesn't appear to be any documentation about any of this stuff.

Here was my best guess which was... wrong. Horribly wrong.

               for (mtx::events::collections::StateEvents &ev : room.state.events)
                       if (auto event = std::get_if<mtx::events::StateEvent<mtx::identifiers::Room>>(&ev);
                                       event != nullptr)
                       {
                               joinedMsg.AddString("chat_name", event->content.name.c_str());
                       }

kallisti5 avatar Dec 22 '23 17:12 kallisti5