Skip to content
Snippets Groups Projects
Commit 40c80b39 authored by Armin Felder's avatar Armin Felder
Browse files

reply message segfault fix

parent cafe3711
No related branches found
No related tags found
1 merge request!79reply message segfault fix
......@@ -109,10 +109,12 @@ QVariant MessagesModel::data( const QModelIndex &index, int role ) const
if ( !first.isNull() ) {
//TODO: WTF!!!
auto msg = qSharedPointerCast<RocketChatReplyMessage>( first );
if ( first->getType() == QStringLiteral( "replyMessage" ) ) {
auto msg = qSharedPointerCast<RocketChatReplyMessage>( first );
if ( !msg.isNull() ) {
return msg->getMessageString();
if ( !msg.isNull() ) {
return msg->getMessageString();
}
}
}
}
......@@ -127,10 +129,12 @@ QVariant MessagesModel::data( const QModelIndex &index, int role ) const
if ( !first.isNull() ) {
//TODO: WTF!!!
auto msg = qSharedPointerCast<RocketChatReplyMessage>( first );
if ( first->getType() == QStringLiteral( "replyMessage" ) ) {
auto msg = qSharedPointerCast<RocketChatReplyMessage>( first );
if ( !msg.isNull() ) {
return msg->getAuthor();
if ( !msg.isNull() ) {
return msg->getAuthor();
}
}
}
}
......
......@@ -28,10 +28,14 @@ class RocketChatAttachment : public QObject
{
Q_OBJECT
public:
RocketChatAttachment( const QString &pFileUrl, const QString &pType, const QString &pTitle );
enum class attachmentsType {
replyMessage
};
RocketChatAttachment( const QString &pFileUrl, const attachmentsType &pType, const QString &pTitle );
const QString &getUrl() const;
const QString &getType() const;
const attachmentsType getType() const;
const QString &getTitle() const;
int getWidth() const;
......@@ -42,7 +46,7 @@ class RocketChatAttachment : public QObject
protected:
QString mUrl;
QString mType;
attachmentsType mType;
QString mTitle;
int mWidth = -1;
int mHeight = -1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment