|
|
|
@ -729,79 +729,7 @@ TimelineView::createDateSeparator(QDateTime datetime) |
|
|
|
|
QString |
|
|
|
|
TimelineView::getEventSender(const mtx::events::collections::TimelineEvents &event) const |
|
|
|
|
{ |
|
|
|
|
using Aliases = mtx::events::StateEvent<mtx::events::state::Aliases>; |
|
|
|
|
using Avatar = mtx::events::StateEvent<mtx::events::state::Avatar>; |
|
|
|
|
using CanonicalAlias = mtx::events::StateEvent<mtx::events::state::CanonicalAlias>; |
|
|
|
|
using Create = mtx::events::StateEvent<mtx::events::state::Create>; |
|
|
|
|
using HistoryVisibility = mtx::events::StateEvent<mtx::events::state::HistoryVisibility>; |
|
|
|
|
using JoinRules = mtx::events::StateEvent<mtx::events::state::JoinRules>; |
|
|
|
|
using Member = mtx::events::StateEvent<mtx::events::state::Member>; |
|
|
|
|
using Name = mtx::events::StateEvent<mtx::events::state::Name>; |
|
|
|
|
using PowerLevels = mtx::events::StateEvent<mtx::events::state::PowerLevels>; |
|
|
|
|
using Topic = mtx::events::StateEvent<mtx::events::state::Topic>; |
|
|
|
|
|
|
|
|
|
using Audio = mtx::events::RoomEvent<mtx::events::msg::Audio>; |
|
|
|
|
using Emote = mtx::events::RoomEvent<mtx::events::msg::Emote>; |
|
|
|
|
using File = mtx::events::RoomEvent<mtx::events::msg::File>; |
|
|
|
|
using Image = mtx::events::RoomEvent<mtx::events::msg::Image>; |
|
|
|
|
using Notice = mtx::events::RoomEvent<mtx::events::msg::Notice>; |
|
|
|
|
using Text = mtx::events::RoomEvent<mtx::events::msg::Text>; |
|
|
|
|
using Video = mtx::events::RoomEvent<mtx::events::msg::Video>; |
|
|
|
|
|
|
|
|
|
if (mpark::holds_alternative<Aliases>(event)) { |
|
|
|
|
auto msg = mpark::get<Aliases>(event); |
|
|
|
|
return QString::fromStdString(msg.sender); |
|
|
|
|
} else if (mpark::holds_alternative<Avatar>(event)) { |
|
|
|
|
auto msg = mpark::get<Avatar>(event); |
|
|
|
|
return QString::fromStdString(msg.sender); |
|
|
|
|
} else if (mpark::holds_alternative<CanonicalAlias>(event)) { |
|
|
|
|
auto msg = mpark::get<CanonicalAlias>(event); |
|
|
|
|
return QString::fromStdString(msg.sender); |
|
|
|
|
} else if (mpark::holds_alternative<Create>(event)) { |
|
|
|
|
auto msg = mpark::get<Create>(event); |
|
|
|
|
return QString::fromStdString(msg.sender); |
|
|
|
|
} else if (mpark::holds_alternative<HistoryVisibility>(event)) { |
|
|
|
|
auto msg = mpark::get<HistoryVisibility>(event); |
|
|
|
|
return QString::fromStdString(msg.sender); |
|
|
|
|
} else if (mpark::holds_alternative<JoinRules>(event)) { |
|
|
|
|
auto msg = mpark::get<JoinRules>(event); |
|
|
|
|
return QString::fromStdString(msg.sender); |
|
|
|
|
} else if (mpark::holds_alternative<Name>(event)) { |
|
|
|
|
auto msg = mpark::get<Name>(event); |
|
|
|
|
return QString::fromStdString(msg.sender); |
|
|
|
|
} else if (mpark::holds_alternative<Member>(event)) { |
|
|
|
|
auto msg = mpark::get<Member>(event); |
|
|
|
|
return QString::fromStdString(msg.sender); |
|
|
|
|
} else if (mpark::holds_alternative<PowerLevels>(event)) { |
|
|
|
|
auto msg = mpark::get<PowerLevels>(event); |
|
|
|
|
return QString::fromStdString(msg.sender); |
|
|
|
|
} else if (mpark::holds_alternative<Topic>(event)) { |
|
|
|
|
auto msg = mpark::get<Topic>(event); |
|
|
|
|
return QString::fromStdString(msg.sender); |
|
|
|
|
} else if (mpark::holds_alternative<Audio>(event)) { |
|
|
|
|
auto msg = mpark::get<Audio>(event); |
|
|
|
|
return QString::fromStdString(msg.sender); |
|
|
|
|
} else if (mpark::holds_alternative<Emote>(event)) { |
|
|
|
|
auto msg = mpark::get<Emote>(event); |
|
|
|
|
return QString::fromStdString(msg.sender); |
|
|
|
|
} else if (mpark::holds_alternative<File>(event)) { |
|
|
|
|
auto msg = mpark::get<File>(event); |
|
|
|
|
return QString::fromStdString(msg.sender); |
|
|
|
|
} else if (mpark::holds_alternative<Image>(event)) { |
|
|
|
|
auto msg = mpark::get<Image>(event); |
|
|
|
|
return QString::fromStdString(msg.sender); |
|
|
|
|
} else if (mpark::holds_alternative<Notice>(event)) { |
|
|
|
|
auto msg = mpark::get<Notice>(event); |
|
|
|
|
return QString::fromStdString(msg.sender); |
|
|
|
|
} else if (mpark::holds_alternative<Text>(event)) { |
|
|
|
|
auto msg = mpark::get<Text>(event); |
|
|
|
|
return QString::fromStdString(msg.sender); |
|
|
|
|
} else if (mpark::holds_alternative<Video>(event)) { |
|
|
|
|
auto msg = mpark::get<Video>(event); |
|
|
|
|
return QString::fromStdString(msg.sender); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return QString(""); |
|
|
|
|
return mpark::visit([](auto msg) { return QString::fromStdString(msg.sender); }, event); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void |
|
|
|
|