summaryrefslogtreecommitdiff
path: root/components/chatwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'components/chatwindow.cpp')
-rw-r--r--components/chatwindow.cpp9
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();