Merge pull request #1027 from Bilb/fix-accept-friend-request

fix bug with accept/reject buttons on friend request
pull/1028/head
Audric Ackermann 6 years ago committed by GitHub
commit c782cbb7bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -247,9 +247,12 @@
async acceptFriendRequest() { async acceptFriendRequest() {
const messages = await window.Signal.Data.getMessagesByConversation( const messages = await window.Signal.Data.getMessagesByConversation(
this.id, this.id,
{ limit: 1, MessageCollection: Whisper.MessageCollection } {
limit: 1,
MessageCollection: Whisper.MessageCollection,
type: 'friend-request',
}
); );
const lastMessageModel = messages.at(0); const lastMessageModel = messages.at(0);
if (lastMessageModel) { if (lastMessageModel) {
lastMessageModel.acceptFriendRequest(); lastMessageModel.acceptFriendRequest();
@ -264,7 +267,11 @@
async declineFriendRequest() { async declineFriendRequest() {
const messages = await window.Signal.Data.getMessagesByConversation( const messages = await window.Signal.Data.getMessagesByConversation(
this.id, this.id,
{ limit: 1, MessageCollection: Whisper.MessageCollection } {
limit: 1,
MessageCollection: Whisper.MessageCollection,
type: 'friend-request',
}
); );
const lastMessageModel = messages.at(0); const lastMessageModel = messages.at(0);

Loading…
Cancel
Save