Calling support
This commit is contained in:
parent
83574eb067
commit
d3a27a6442
72 changed files with 3864 additions and 191 deletions
|
@ -1033,6 +1033,30 @@
|
|||
}
|
||||
},
|
||||
|
||||
async addCallHistory(callHistoryDetails) {
|
||||
const { acceptedTime, endedTime, wasDeclined } = callHistoryDetails;
|
||||
const message = {
|
||||
conversationId: this.id,
|
||||
type: 'call-history',
|
||||
sent_at: endedTime,
|
||||
received_at: endedTime,
|
||||
unread: !wasDeclined && !acceptedTime,
|
||||
callHistoryDetails,
|
||||
};
|
||||
|
||||
const id = await window.Signal.Data.saveMessage(message, {
|
||||
Message: Whisper.Message,
|
||||
});
|
||||
const model = MessageController.register(
|
||||
id,
|
||||
new Whisper.Message({
|
||||
...message,
|
||||
id,
|
||||
})
|
||||
);
|
||||
this.trigger('newmessage', model);
|
||||
},
|
||||
|
||||
async onReadMessage(message, readAt) {
|
||||
// We mark as read everything older than this message - to clean up old stuff
|
||||
// still marked unread in the database. If the user generally doesn't read in
|
||||
|
|
|
@ -178,6 +178,11 @@
|
|||
type: 'resetSessionNotification',
|
||||
data: this.getPropsForResetSessionNotification(),
|
||||
};
|
||||
} else if (this.isCallHistory()) {
|
||||
return {
|
||||
type: 'callHistory',
|
||||
data: this.getPropsForCallHistory(),
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
|
@ -366,6 +371,9 @@
|
|||
// eslint-disable-next-line no-bitwise
|
||||
return !!(this.get('flags') & flag);
|
||||
},
|
||||
isCallHistory() {
|
||||
return this.get('type') === 'call-history';
|
||||
},
|
||||
|
||||
// Props for each message type
|
||||
getPropsForUnsupportedMessage() {
|
||||
|
@ -500,6 +508,11 @@
|
|||
// It doesn't need anything right now!
|
||||
return {};
|
||||
},
|
||||
getPropsForCallHistory() {
|
||||
return {
|
||||
callHistoryDetails: this.get('callHistoryDetails'),
|
||||
};
|
||||
},
|
||||
getAttachmentsForMessage() {
|
||||
const sticker = this.get('sticker');
|
||||
if (sticker && sticker.data) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue