aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-04-09 00:51:24 +0200
committerdec05eba <dec05eba@protonmail.com>2020-08-18 23:38:23 +0200
commitf58b5becfa45818a6825e28c394ee2ee7d92d147 (patch)
tree144dd79615b5a89a01a27674ac2948e132698743
parent0cae593b94c4fdfe100516c7f08f75e40bc1e089 (diff)
Fix invite user crash, set avatar url
-rw-r--r--include/dchat/Room.hpp2
-rw-r--r--src/Room.cpp5
2 files changed, 4 insertions, 3 deletions
diff --git a/include/dchat/Room.hpp b/include/dchat/Room.hpp
index 6681cdc..b27ca03 100644
--- a/include/dchat/Room.hpp
+++ b/include/dchat/Room.hpp
@@ -107,7 +107,7 @@ namespace dchat
struct InviteUserRequest
{
- std::shared_ptr<Room> room;
+ Room *room;
odhtdb::Signature::PublicKey userPublicKey;
std::string message;
};
diff --git a/src/Room.cpp b/src/Room.cpp
index bc87c05..44407c1 100644
--- a/src/Room.cpp
+++ b/src/Room.cpp
@@ -143,7 +143,7 @@ namespace dchat
if(rooms->callbackFuncs.receiveInviteUserCallbackFunc)
{
InviteUserRequest request;
- request.room = std::shared_ptr<Room>(this);
+ request.room = this;
request.userPublicKey = std::move(userPublicKey);
request.message = std::move(userMsg);
rooms->callbackFuncs.receiveInviteUserCallbackFunc(request);
@@ -366,9 +366,10 @@ namespace dchat
roomRequest.user = user;
roomRequest.timestampSeconds = timestampSeconds;
roomRequest.loadedFromCache = request.loadedFromCache;
- roomRequest.url = std::move(url);
+ roomRequest.url = url;
if(callbackFuncs.userChangeAvatarCallbackFunc)
callbackFuncs.userChangeAvatarCallbackFunc(roomRequest);
+ user->avatarUrl = std::move(url);
}
break;
}