Skip to content

Examples: Getting room names #103

Open
@kallisti5

Description

@kallisti5

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());
                       }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

      Participants

      @kallisti5

      Issue actions

        Examples: Getting room names · Issue #103 · Nheko-Reborn/mtxclient