Message Requests improvements

This commit is contained in:
Scott Nonnenberg 2020-08-06 17:50:54 -07:00 committed by GitHub
parent b63291507a
commit 81cb7730a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 302 additions and 263 deletions

View file

@ -16,6 +16,8 @@
(function() {
'use strict';
const FIVE_MINUTES = 1000 * 60 * 5;
window.Whisper = window.Whisper || {};
const { Message, MIME, VisualAttachment } = window.Signal.Types;
const {
@ -304,9 +306,12 @@
);
this.model.throttledGetProfiles =
this.model.throttledGetProfiles ||
_.throttle(this.model.getProfiles.bind(this.model), FIVE_MINUTES);
this.model.throttledUpdateSharedGroups =
this.model.throttledUpdateSharedGroups ||
_.throttle(
this.model.getProfiles.bind(this.model),
1000 * 60 * 5 // five minutes
this.model.updateSharedGroups.bind(this.model),
FIVE_MINUTES
);
this.debouncedMaybeGrabLinkPreview = _.debounce(
this.maybeGrabLinkPreview.bind(this),
@ -720,6 +725,7 @@
showVisualAttachment,
showExpiredIncomingTapToViewToast,
showExpiredOutgoingTapToViewToast,
updateSharedGroups: this.model.throttledUpdateSharedGroups,
}),
});