diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2020-09-03 01:54:40 -0400 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2020-09-03 01:54:40 -0400 |
commit | 2fab0c3e0df870378055fe2f66f3b37f7d0929fc (patch) | |
tree | 0155f25329c2a68d50aa35b77edd5e0eb50c3462 /components/chatwindow.cpp | |
parent | 76cabbd37f6197200ca3e8ac34e1b69553857da9 (diff) | |
download | abaddon-portaudio-2fab0c3e0df870378055fe2f66f3b37f7d0929fc.tar.gz abaddon-portaudio-2fab0c3e0df870378055fe2f66f3b37f7d0929fc.zip |
very primitive embeds
Diffstat (limited to 'components/chatwindow.cpp')
-rw-r--r-- | components/chatwindow.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/components/chatwindow.cpp b/components/chatwindow.cpp index e3ceb88..ca7b549 100644 --- a/components/chatwindow.cpp +++ b/components/chatwindow.cpp @@ -85,6 +85,8 @@ Snowflake ChatWindow::GetActiveChannel() const { ChatDisplayType ChatWindow::GetMessageDisplayType(const MessageData *data) { if (data->Type == MessageType::DEFAULT && data->Content.size() > 0) return ChatDisplayType::Text; + else if (data->Type == MessageType::DEFAULT && data->Embeds.size() > 0) + return ChatDisplayType::Embed; return ChatDisplayType::Unknown; } @@ -121,6 +123,13 @@ void ChatWindow::ProcessMessage(const MessageData *data, bool prepend) { text->SetAbaddon(m_abaddon); container->AddNewContent(text, prepend); m_id_to_widget[data->ID] = text; + } else if (type == ChatDisplayType::Embed) { + auto *widget = Gtk::manage(new ChatMessageEmbedItem(data)); + widget->ID = data->ID; + widget->ChannelID = m_active_channel; + widget->SetAbaddon(m_abaddon); + container->AddNewContent(widget, prepend); + m_id_to_widget[data->ID] = widget; } container->show_all(); |