Fix message_type not being initialized correctly

Fixes "sent an audio file" replies, that were actually replies to text
messages.
This commit is contained in:
Nicolas Werner 2019-07-28 16:50:04 +02:00
parent dbb8eecf29
commit b28115eb37
2 changed files with 13 additions and 1 deletions

View file

@ -282,6 +282,7 @@ TimelineItem::TimelineItem(mtx::events::MessageType ty,
const QString &room_id,
QWidget *parent)
: QWidget(parent)
, message_type_(ty)
, room_id_{room_id}
{
init();
@ -341,6 +342,7 @@ TimelineItem::TimelineItem(ImageItem *image,
const QString &room_id,
QWidget *parent)
: QWidget{parent}
, message_type_(mtx::events::MessageType::Image)
, room_id_{room_id}
{
init();
@ -356,6 +358,7 @@ TimelineItem::TimelineItem(FileItem *file,
const QString &room_id,
QWidget *parent)
: QWidget{parent}
, message_type_(mtx::events::MessageType::File)
, room_id_{room_id}
{
init();
@ -369,6 +372,7 @@ TimelineItem::TimelineItem(AudioItem *audio,
const QString &room_id,
QWidget *parent)
: QWidget{parent}
, message_type_(mtx::events::MessageType::Audio)
, room_id_{room_id}
{
init();
@ -382,6 +386,7 @@ TimelineItem::TimelineItem(VideoItem *video,
const QString &room_id,
QWidget *parent)
: QWidget{parent}
, message_type_(mtx::events::MessageType::Video)
, room_id_{room_id}
{
init();
@ -395,6 +400,7 @@ TimelineItem::TimelineItem(ImageItem *image,
const QString &room_id,
QWidget *parent)
: QWidget(parent)
, message_type_(mtx::events::MessageType::Image)
, room_id_{room_id}
{
setupWidgetLayout<mtx::events::RoomEvent<mtx::events::msg::Image>, ImageItem>(
@ -426,6 +432,7 @@ TimelineItem::TimelineItem(FileItem *file,
const QString &room_id,
QWidget *parent)
: QWidget(parent)
, message_type_(mtx::events::MessageType::File)
, room_id_{room_id}
{
setupWidgetLayout<mtx::events::RoomEvent<mtx::events::msg::File>, FileItem>(
@ -440,6 +447,7 @@ TimelineItem::TimelineItem(AudioItem *audio,
const QString &room_id,
QWidget *parent)
: QWidget(parent)
, message_type_(mtx::events::MessageType::Audio)
, room_id_{room_id}
{
setupWidgetLayout<mtx::events::RoomEvent<mtx::events::msg::Audio>, AudioItem>(
@ -454,6 +462,7 @@ TimelineItem::TimelineItem(VideoItem *video,
const QString &room_id,
QWidget *parent)
: QWidget(parent)
, message_type_(mtx::events::MessageType::Video)
, room_id_{room_id}
{
setupWidgetLayout<mtx::events::RoomEvent<mtx::events::msg::Video>, VideoItem>(
@ -470,6 +479,7 @@ TimelineItem::TimelineItem(const mtx::events::RoomEvent<mtx::events::msg::Notice
const QString &room_id,
QWidget *parent)
: QWidget(parent)
, message_type_(mtx::events::MessageType::Notice)
, room_id_{room_id}
{
init();
@ -517,6 +527,7 @@ TimelineItem::TimelineItem(const mtx::events::RoomEvent<mtx::events::msg::Emote>
const QString &room_id,
QWidget *parent)
: QWidget(parent)
, message_type_(mtx::events::MessageType::Emote)
, room_id_{room_id}
{
init();
@ -565,6 +576,7 @@ TimelineItem::TimelineItem(const mtx::events::RoomEvent<mtx::events::msg::Text>
const QString &room_id,
QWidget *parent)
: QWidget(parent)
, message_type_(mtx::events::MessageType::Text)
, room_id_{room_id}
{
init();

View file

@ -277,7 +277,7 @@ private:
QFutureWatcher<QString> *colorGenerating_;
QString event_id_;
mtx::events::MessageType message_type_;
mtx::events::MessageType message_type_ = mtx::events::MessageType::Unknown;
QString room_id_;
DescInfo descriptionMsg_;