Fix NeoChatRoom::directChatRemoteMember
- Don't access member that's not there
- Use NeoChatRoomMember instead of RoomMember
BUG: 492733
(cherry picked from commit 2a5359e73b)
Co-authored-by: Tobias Fella <fella@posteo.de>
This commit is contained in:
@@ -1705,9 +1705,13 @@ int NeoChatRoom::maxRoomVersion() const
|
|||||||
return maxVersion;
|
return maxVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
Quotient::RoomMember NeoChatRoom::directChatRemoteMember() const
|
NeochatRoomMember *NeoChatRoom::directChatRemoteMember()
|
||||||
{
|
{
|
||||||
return directChatMembers()[0];
|
if (directChatMembers().size() == 0) {
|
||||||
|
qWarning() << "No other member available in this room";
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
return new NeochatRoomMember(this, directChatMembers()[0].id());
|
||||||
}
|
}
|
||||||
|
|
||||||
void NeoChatRoom::sendLocation(float lat, float lon, const QString &description)
|
void NeoChatRoom::sendLocation(float lat, float lon, const QString &description)
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
#include <Quotient/roommember.h>
|
#include <Quotient/roommember.h>
|
||||||
|
|
||||||
#include "enums/pushrule.h"
|
#include "enums/pushrule.h"
|
||||||
|
#include "neochatroommember.h"
|
||||||
#include "pollhandler.h"
|
#include "pollhandler.h"
|
||||||
|
|
||||||
namespace Quotient
|
namespace Quotient
|
||||||
@@ -74,7 +75,7 @@ class NeoChatRoom : public Quotient::Room
|
|||||||
/**
|
/**
|
||||||
* @brief Get a RoomMember object for the other person in a direct chat.
|
* @brief Get a RoomMember object for the other person in a direct chat.
|
||||||
*/
|
*/
|
||||||
Q_PROPERTY(Quotient::RoomMember directChatRemoteMember READ directChatRemoteMember CONSTANT)
|
Q_PROPERTY(NeochatRoomMember *directChatRemoteMember READ directChatRemoteMember CONSTANT)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The Matrix IDs of this room's parents.
|
* @brief The Matrix IDs of this room's parents.
|
||||||
@@ -319,7 +320,7 @@ public:
|
|||||||
|
|
||||||
[[nodiscard]] QString avatarMediaId() const;
|
[[nodiscard]] QString avatarMediaId() const;
|
||||||
|
|
||||||
Quotient::RoomMember directChatRemoteMember() const;
|
NeochatRoomMember *directChatRemoteMember();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Whether this room has one or more parent spaces set.
|
* @brief Whether this room has one or more parent spaces set.
|
||||||
|
|||||||
Reference in New Issue
Block a user