sceyt-chat-react-uikit 1.8.7-beta.6 → 1.8.7-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +436 -800
- package/index.modern.js +436 -800
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -2683,463 +2683,9 @@ var FIXED_TIMER_OPTIONS = {
|
|
|
2683
2683
|
custom: 60 * 60 * 24 * 2
|
|
2684
2684
|
};
|
|
2685
2685
|
|
|
2686
|
-
// A type of promise-like that resolves synchronously and supports only one observer
|
|
2687
|
-
const _Pact = /*#__PURE__*/(function() {
|
|
2688
|
-
function _Pact() {}
|
|
2689
|
-
_Pact.prototype.then = function(onFulfilled, onRejected) {
|
|
2690
|
-
const result = new _Pact();
|
|
2691
|
-
const state = this.s;
|
|
2692
|
-
if (state) {
|
|
2693
|
-
const callback = state & 1 ? onFulfilled : onRejected;
|
|
2694
|
-
if (callback) {
|
|
2695
|
-
try {
|
|
2696
|
-
_settle(result, 1, callback(this.v));
|
|
2697
|
-
} catch (e) {
|
|
2698
|
-
_settle(result, 2, e);
|
|
2699
|
-
}
|
|
2700
|
-
return result;
|
|
2701
|
-
} else {
|
|
2702
|
-
return this;
|
|
2703
|
-
}
|
|
2704
|
-
}
|
|
2705
|
-
this.o = function(_this) {
|
|
2706
|
-
try {
|
|
2707
|
-
const value = _this.v;
|
|
2708
|
-
if (_this.s & 1) {
|
|
2709
|
-
_settle(result, 1, onFulfilled ? onFulfilled(value) : value);
|
|
2710
|
-
} else if (onRejected) {
|
|
2711
|
-
_settle(result, 1, onRejected(value));
|
|
2712
|
-
} else {
|
|
2713
|
-
_settle(result, 2, value);
|
|
2714
|
-
}
|
|
2715
|
-
} catch (e) {
|
|
2716
|
-
_settle(result, 2, e);
|
|
2717
|
-
}
|
|
2718
|
-
};
|
|
2719
|
-
return result;
|
|
2720
|
-
};
|
|
2721
|
-
return _Pact;
|
|
2722
|
-
})();
|
|
2723
|
-
|
|
2724
|
-
// Settles a pact synchronously
|
|
2725
|
-
function _settle(pact, state, value) {
|
|
2726
|
-
if (!pact.s) {
|
|
2727
|
-
if (value instanceof _Pact) {
|
|
2728
|
-
if (value.s) {
|
|
2729
|
-
if (state & 1) {
|
|
2730
|
-
state = value.s;
|
|
2731
|
-
}
|
|
2732
|
-
value = value.v;
|
|
2733
|
-
} else {
|
|
2734
|
-
value.o = _settle.bind(null, pact, state);
|
|
2735
|
-
return;
|
|
2736
|
-
}
|
|
2737
|
-
}
|
|
2738
|
-
if (value && value.then) {
|
|
2739
|
-
value.then(_settle.bind(null, pact, state), _settle.bind(null, pact, 2));
|
|
2740
|
-
return;
|
|
2741
|
-
}
|
|
2742
|
-
pact.s = state;
|
|
2743
|
-
pact.v = value;
|
|
2744
|
-
const observer = pact.o;
|
|
2745
|
-
if (observer) {
|
|
2746
|
-
observer(pact);
|
|
2747
|
-
}
|
|
2748
|
-
}
|
|
2749
|
-
}
|
|
2750
|
-
|
|
2751
|
-
function _isSettledPact(thenable) {
|
|
2752
|
-
return thenable instanceof _Pact && thenable.s & 1;
|
|
2753
|
-
}
|
|
2754
|
-
|
|
2755
|
-
// Asynchronously iterate through an object that has a length property, passing the index as the first argument to the callback (even as the length property changes)
|
|
2756
|
-
function _forTo(array, body, check) {
|
|
2757
|
-
var i = -1, pact, reject;
|
|
2758
|
-
function _cycle(result) {
|
|
2759
|
-
try {
|
|
2760
|
-
while (++i < array.length && (!check || !check())) {
|
|
2761
|
-
result = body(i);
|
|
2762
|
-
if (result && result.then) {
|
|
2763
|
-
if (_isSettledPact(result)) {
|
|
2764
|
-
result = result.v;
|
|
2765
|
-
} else {
|
|
2766
|
-
result.then(_cycle, reject || (reject = _settle.bind(null, pact = new _Pact(), 2)));
|
|
2767
|
-
return;
|
|
2768
|
-
}
|
|
2769
|
-
}
|
|
2770
|
-
}
|
|
2771
|
-
if (pact) {
|
|
2772
|
-
_settle(pact, 1, result);
|
|
2773
|
-
} else {
|
|
2774
|
-
pact = result;
|
|
2775
|
-
}
|
|
2776
|
-
} catch (e) {
|
|
2777
|
-
_settle(pact || (pact = new _Pact()), 2, e);
|
|
2778
|
-
}
|
|
2779
|
-
}
|
|
2780
|
-
_cycle();
|
|
2781
|
-
return pact;
|
|
2782
|
-
}
|
|
2783
|
-
|
|
2784
|
-
const _iteratorSymbol = /*#__PURE__*/ typeof Symbol !== "undefined" ? (Symbol.iterator || (Symbol.iterator = Symbol("Symbol.iterator"))) : "@@iterator";
|
|
2785
|
-
|
|
2786
|
-
// Asynchronously iterate through an object's values
|
|
2787
|
-
// Uses for...of if the runtime supports it, otherwise iterates until length on a copy
|
|
2788
|
-
function _forOf(target, body, check) {
|
|
2789
|
-
if (typeof target[_iteratorSymbol] === "function") {
|
|
2790
|
-
var iterator = target[_iteratorSymbol](), step, pact, reject;
|
|
2791
|
-
function _cycle(result) {
|
|
2792
|
-
try {
|
|
2793
|
-
while (!(step = iterator.next()).done && (!check || !check())) {
|
|
2794
|
-
result = body(step.value);
|
|
2795
|
-
if (result && result.then) {
|
|
2796
|
-
if (_isSettledPact(result)) {
|
|
2797
|
-
result = result.v;
|
|
2798
|
-
} else {
|
|
2799
|
-
result.then(_cycle, reject || (reject = _settle.bind(null, pact = new _Pact(), 2)));
|
|
2800
|
-
return;
|
|
2801
|
-
}
|
|
2802
|
-
}
|
|
2803
|
-
}
|
|
2804
|
-
if (pact) {
|
|
2805
|
-
_settle(pact, 1, result);
|
|
2806
|
-
} else {
|
|
2807
|
-
pact = result;
|
|
2808
|
-
}
|
|
2809
|
-
} catch (e) {
|
|
2810
|
-
_settle(pact || (pact = new _Pact()), 2, e);
|
|
2811
|
-
}
|
|
2812
|
-
}
|
|
2813
|
-
_cycle();
|
|
2814
|
-
if (iterator.return) {
|
|
2815
|
-
var _fixup = function(value) {
|
|
2816
|
-
try {
|
|
2817
|
-
if (!step.done) {
|
|
2818
|
-
iterator.return();
|
|
2819
|
-
}
|
|
2820
|
-
} catch(e) {
|
|
2821
|
-
}
|
|
2822
|
-
return value;
|
|
2823
|
-
};
|
|
2824
|
-
if (pact && pact.then) {
|
|
2825
|
-
return pact.then(_fixup, function(e) {
|
|
2826
|
-
throw _fixup(e);
|
|
2827
|
-
});
|
|
2828
|
-
}
|
|
2829
|
-
_fixup();
|
|
2830
|
-
}
|
|
2831
|
-
return pact;
|
|
2832
|
-
}
|
|
2833
|
-
// No support for Symbol.iterator
|
|
2834
|
-
if (!("length" in target)) {
|
|
2835
|
-
throw new TypeError("Object is not iterable");
|
|
2836
|
-
}
|
|
2837
|
-
// Handle live collections properly
|
|
2838
|
-
var values = [];
|
|
2839
|
-
for (var i = 0; i < target.length; i++) {
|
|
2840
|
-
values.push(target[i]);
|
|
2841
|
-
}
|
|
2842
|
-
return _forTo(values, function(i) { return body(values[i]); }, check);
|
|
2843
|
-
}
|
|
2844
|
-
|
|
2845
|
-
const _asyncIteratorSymbol = /*#__PURE__*/ typeof Symbol !== "undefined" ? (Symbol.asyncIterator || (Symbol.asyncIterator = Symbol("Symbol.asyncIterator"))) : "@@asyncIterator";
|
|
2846
|
-
|
|
2847
|
-
// Asynchronously call a function and send errors to recovery continuation
|
|
2848
|
-
function _catch(body, recover) {
|
|
2849
|
-
try {
|
|
2850
|
-
var result = body();
|
|
2851
|
-
} catch(e) {
|
|
2852
|
-
return recover(e);
|
|
2853
|
-
}
|
|
2854
|
-
if (result && result.then) {
|
|
2855
|
-
return result.then(void 0, recover);
|
|
2856
|
-
}
|
|
2857
|
-
return result;
|
|
2858
|
-
}
|
|
2859
|
-
|
|
2860
|
-
// Asynchronously await a promise and pass the result to a finally continuation
|
|
2861
|
-
function _finallyRethrows(body, finalizer) {
|
|
2862
|
-
try {
|
|
2863
|
-
var result = body();
|
|
2864
|
-
} catch (e) {
|
|
2865
|
-
return finalizer(true, e);
|
|
2866
|
-
}
|
|
2867
|
-
if (result && result.then) {
|
|
2868
|
-
return result.then(finalizer.bind(null, false), finalizer.bind(null, true));
|
|
2869
|
-
}
|
|
2870
|
-
return finalizer(false, result);
|
|
2871
|
-
}
|
|
2872
|
-
|
|
2873
|
-
var openDatabase = function openDatabase(dbName) {
|
|
2874
|
-
return new Promise(function (resolve, reject) {
|
|
2875
|
-
var request = indexedDB.open(dbName);
|
|
2876
|
-
request.onsuccess = function () {
|
|
2877
|
-
return resolve(request.result);
|
|
2878
|
-
};
|
|
2879
|
-
request.onerror = function () {
|
|
2880
|
-
return reject(request.error);
|
|
2881
|
-
};
|
|
2882
|
-
});
|
|
2883
|
-
};
|
|
2884
|
-
var runUpgrade = function runUpgrade(dbName, onUpgrade) {
|
|
2885
|
-
try {
|
|
2886
|
-
return Promise.resolve(openDatabase(dbName)).then(function (db) {
|
|
2887
|
-
var nextVersion = db.version + 1;
|
|
2888
|
-
db.close();
|
|
2889
|
-
return new Promise(function (resolve, reject) {
|
|
2890
|
-
var request = indexedDB.open(dbName, nextVersion);
|
|
2891
|
-
request.onupgradeneeded = function () {
|
|
2892
|
-
var upgradeDb = request.result;
|
|
2893
|
-
onUpgrade(upgradeDb);
|
|
2894
|
-
};
|
|
2895
|
-
request.onsuccess = function () {
|
|
2896
|
-
return resolve(request.result);
|
|
2897
|
-
};
|
|
2898
|
-
request.onerror = function () {
|
|
2899
|
-
return reject(request.error);
|
|
2900
|
-
};
|
|
2901
|
-
request.onblocked = function () {
|
|
2902
|
-
log.warn('IndexedDB upgrade blocked; close other tabs to proceed');
|
|
2903
|
-
};
|
|
2904
|
-
});
|
|
2905
|
-
});
|
|
2906
|
-
} catch (e) {
|
|
2907
|
-
return Promise.reject(e);
|
|
2908
|
-
}
|
|
2909
|
-
};
|
|
2910
|
-
var ensureStore = function ensureStore(dbName, storeName, keyPath) {
|
|
2911
|
-
try {
|
|
2912
|
-
return Promise.resolve(openDatabase(dbName)).then(function (db) {
|
|
2913
|
-
if (db.objectStoreNames.contains(storeName)) {
|
|
2914
|
-
return db;
|
|
2915
|
-
}
|
|
2916
|
-
db.close();
|
|
2917
|
-
return Promise.resolve(runUpgrade(dbName, function (upgradeDb) {
|
|
2918
|
-
if (!upgradeDb.objectStoreNames.contains(storeName)) {
|
|
2919
|
-
upgradeDb.createObjectStore(storeName, {
|
|
2920
|
-
keyPath: keyPath
|
|
2921
|
-
});
|
|
2922
|
-
}
|
|
2923
|
-
}));
|
|
2924
|
-
});
|
|
2925
|
-
} catch (e) {
|
|
2926
|
-
return Promise.reject(e);
|
|
2927
|
-
}
|
|
2928
|
-
};
|
|
2929
|
-
var awaitTransaction = function awaitTransaction(tx) {
|
|
2930
|
-
return new Promise(function (resolve, reject) {
|
|
2931
|
-
tx.oncomplete = function () {
|
|
2932
|
-
return resolve();
|
|
2933
|
-
};
|
|
2934
|
-
tx.onerror = function () {
|
|
2935
|
-
return reject(tx.error);
|
|
2936
|
-
};
|
|
2937
|
-
tx.onabort = function () {
|
|
2938
|
-
return reject(tx.error);
|
|
2939
|
-
};
|
|
2940
|
-
});
|
|
2941
|
-
};
|
|
2942
|
-
var putWithPossibleOutOfLineKey = function putWithPossibleOutOfLineKey(store, value, keyField) {
|
|
2943
|
-
try {
|
|
2944
|
-
if (store.keyPath !== null) {
|
|
2945
|
-
store.put(value);
|
|
2946
|
-
return;
|
|
2947
|
-
}
|
|
2948
|
-
} catch (e) {}
|
|
2949
|
-
var explicitKey = value === null || value === void 0 ? void 0 : value[keyField];
|
|
2950
|
-
if (explicitKey === undefined || explicitKey === null) {
|
|
2951
|
-
throw new Error("IndexedDB put requires explicit key but value has no '" + keyField + "' field");
|
|
2952
|
-
}
|
|
2953
|
-
store.put(value, explicitKey);
|
|
2954
|
-
};
|
|
2955
|
-
var setDataToDB = function setDataToDB(dbName, storeName, data, keyPath) {
|
|
2956
|
-
try {
|
|
2957
|
-
if (!('indexedDB' in window)) {
|
|
2958
|
-
log.info("This browser doesn't support IndexedDB");
|
|
2959
|
-
return Promise.resolve();
|
|
2960
|
-
}
|
|
2961
|
-
return Promise.resolve(ensureStore(dbName, storeName, keyPath)).then(function (db) {
|
|
2962
|
-
var _temp = _finallyRethrows(function () {
|
|
2963
|
-
var tx = db.transaction(storeName, 'readwrite');
|
|
2964
|
-
var store = tx.objectStore(storeName);
|
|
2965
|
-
data.forEach(function (value) {
|
|
2966
|
-
putWithPossibleOutOfLineKey(store, value, keyPath);
|
|
2967
|
-
});
|
|
2968
|
-
return Promise.resolve(awaitTransaction(tx)).then(function () {});
|
|
2969
|
-
}, function (_wasThrown, _result) {
|
|
2970
|
-
db.close();
|
|
2971
|
-
if (_wasThrown) throw _result;
|
|
2972
|
-
return _result;
|
|
2973
|
-
});
|
|
2974
|
-
if (_temp && _temp.then) return _temp.then(function () {});
|
|
2975
|
-
});
|
|
2976
|
-
} catch (e) {
|
|
2977
|
-
return Promise.reject(e);
|
|
2978
|
-
}
|
|
2979
|
-
};
|
|
2980
|
-
var getDataFromDB = function getDataFromDB(dbName, storeName, keyPathValue, keyPathName) {
|
|
2981
|
-
try {
|
|
2982
|
-
return Promise.resolve(_catch(function () {
|
|
2983
|
-
return Promise.resolve(openDatabase(dbName)).then(function (db) {
|
|
2984
|
-
var _exit = false;
|
|
2985
|
-
function _temp5(_result2) {
|
|
2986
|
-
if (_exit) return _result2;
|
|
2987
|
-
var tx = db.transaction(storeName, 'readonly');
|
|
2988
|
-
var objectStore = tx.objectStore(storeName);
|
|
2989
|
-
return Promise.resolve(new Promise(function (resolve, reject) {
|
|
2990
|
-
var request = objectStore.get(keyPathValue);
|
|
2991
|
-
request.onsuccess = function () {
|
|
2992
|
-
return resolve(request.result);
|
|
2993
|
-
};
|
|
2994
|
-
request.onerror = function () {
|
|
2995
|
-
return reject(request.error);
|
|
2996
|
-
};
|
|
2997
|
-
})).then(function (result) {
|
|
2998
|
-
db.close();
|
|
2999
|
-
return result || '';
|
|
3000
|
-
});
|
|
3001
|
-
}
|
|
3002
|
-
var _temp4 = function () {
|
|
3003
|
-
if (!db.objectStoreNames.contains(storeName)) {
|
|
3004
|
-
var _temp3 = function _temp3() {
|
|
3005
|
-
_exit = true;
|
|
3006
|
-
return '';
|
|
3007
|
-
};
|
|
3008
|
-
db.close();
|
|
3009
|
-
var _temp2 = function () {
|
|
3010
|
-
if (keyPathName) {
|
|
3011
|
-
return Promise.resolve(ensureStore(dbName, storeName, keyPathName)).then(function (upgraded) {
|
|
3012
|
-
upgraded.close();
|
|
3013
|
-
});
|
|
3014
|
-
}
|
|
3015
|
-
}();
|
|
3016
|
-
return _temp2 && _temp2.then ? _temp2.then(_temp3) : _temp3(_temp2);
|
|
3017
|
-
}
|
|
3018
|
-
}();
|
|
3019
|
-
return _temp4 && _temp4.then ? _temp4.then(_temp5) : _temp5(_temp4);
|
|
3020
|
-
});
|
|
3021
|
-
}, function (error) {
|
|
3022
|
-
log.error('Error retrieving data: ', error);
|
|
3023
|
-
return '';
|
|
3024
|
-
}));
|
|
3025
|
-
} catch (e) {
|
|
3026
|
-
return Promise.reject(e);
|
|
3027
|
-
}
|
|
3028
|
-
};
|
|
3029
|
-
var getAllStoreNames = function getAllStoreNames(dbName) {
|
|
3030
|
-
try {
|
|
3031
|
-
return Promise.resolve(openDatabase(dbName)).then(function (db) {
|
|
3032
|
-
try {
|
|
3033
|
-
return Array.from(db.objectStoreNames);
|
|
3034
|
-
} finally {
|
|
3035
|
-
db.close();
|
|
3036
|
-
}
|
|
3037
|
-
});
|
|
3038
|
-
} catch (e) {
|
|
3039
|
-
return Promise.reject(e);
|
|
3040
|
-
}
|
|
3041
|
-
};
|
|
3042
|
-
var deleteStore = function deleteStore(dbName, storeName) {
|
|
3043
|
-
try {
|
|
3044
|
-
return Promise.resolve(openDatabase(dbName)).then(function (db) {
|
|
3045
|
-
var shouldDelete = db.objectStoreNames.contains(storeName);
|
|
3046
|
-
db.close();
|
|
3047
|
-
if (!shouldDelete) return;
|
|
3048
|
-
return Promise.resolve(runUpgrade(dbName, function (upgradeDb) {
|
|
3049
|
-
if (upgradeDb.objectStoreNames.contains(storeName)) {
|
|
3050
|
-
upgradeDb.deleteObjectStore(storeName);
|
|
3051
|
-
}
|
|
3052
|
-
})).then(function (upgraded) {
|
|
3053
|
-
upgraded.close();
|
|
3054
|
-
});
|
|
3055
|
-
});
|
|
3056
|
-
} catch (e) {
|
|
3057
|
-
return Promise.reject(e);
|
|
3058
|
-
}
|
|
3059
|
-
};
|
|
3060
|
-
|
|
3061
|
-
var METADATA_DB_NAME = 'sceyt-metadata-db';
|
|
3062
|
-
var getCurrentMonthKey = function getCurrentMonthKey() {
|
|
3063
|
-
var now = new Date();
|
|
3064
|
-
return String(now.getMonth() + 1).padStart(2, '0') + "-" + now.getFullYear();
|
|
3065
|
-
};
|
|
3066
|
-
var getPreviousMonthKey = function getPreviousMonthKey() {
|
|
3067
|
-
var now = new Date();
|
|
3068
|
-
var previousMonth = new Date(now.getFullYear(), now.getMonth() - 1, 1);
|
|
3069
|
-
return String(previousMonth.getMonth() + 1).padStart(2, '0') + "-" + previousMonth.getFullYear();
|
|
3070
|
-
};
|
|
3071
|
-
var storeMetadata = function storeMetadata(url, metadata) {
|
|
3072
|
-
try {
|
|
3073
|
-
var currentMonth = getCurrentMonthKey();
|
|
3074
|
-
var metadataRecord = _extends({}, metadata, {
|
|
3075
|
-
url: url,
|
|
3076
|
-
timestamp: Date.now()
|
|
3077
|
-
});
|
|
3078
|
-
var _temp = _catch(function () {
|
|
3079
|
-
return Promise.resolve(setDataToDB(METADATA_DB_NAME, currentMonth, [metadataRecord], 'url')).then(function () {});
|
|
3080
|
-
}, function (error) {
|
|
3081
|
-
console.error('Failed to store metadata in IndexedDB:', error);
|
|
3082
|
-
});
|
|
3083
|
-
return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
|
|
3084
|
-
} catch (e) {
|
|
3085
|
-
return Promise.reject(e);
|
|
3086
|
-
}
|
|
3087
|
-
};
|
|
3088
|
-
var cleanupOldMonthsMetadata = function cleanupOldMonthsMetadata() {
|
|
3089
|
-
try {
|
|
3090
|
-
return Promise.resolve(_catch(function () {
|
|
3091
|
-
var currentMonth = getCurrentMonthKey();
|
|
3092
|
-
var previousMonth = getPreviousMonthKey();
|
|
3093
|
-
return Promise.resolve(getAllStoreNames(METADATA_DB_NAME)).then(function (allStores) {
|
|
3094
|
-
function _temp4() {
|
|
3095
|
-
if (storesToDelete.length > 0) {
|
|
3096
|
-
console.log("Cleaned up " + storesToDelete.length + " old month stores: " + storesToDelete.join(', '));
|
|
3097
|
-
}
|
|
3098
|
-
}
|
|
3099
|
-
var storesToDelete = allStores.filter(function (storeName) {
|
|
3100
|
-
return storeName !== currentMonth && storeName !== previousMonth;
|
|
3101
|
-
});
|
|
3102
|
-
var _temp3 = _forOf(storesToDelete, function (storeName) {
|
|
3103
|
-
var _temp2 = _catch(function () {
|
|
3104
|
-
return Promise.resolve(deleteStore(METADATA_DB_NAME, storeName)).then(function () {
|
|
3105
|
-
console.log("Deleted old month store: " + storeName);
|
|
3106
|
-
return Promise.resolve(new Promise(function (resolve) {
|
|
3107
|
-
return setTimeout(resolve, 100);
|
|
3108
|
-
})).then(function () {});
|
|
3109
|
-
});
|
|
3110
|
-
}, function (error) {
|
|
3111
|
-
console.error("Failed to delete store " + storeName + ":", error);
|
|
3112
|
-
});
|
|
3113
|
-
if (_temp2 && _temp2.then) return _temp2.then(function () {});
|
|
3114
|
-
});
|
|
3115
|
-
return _temp3 && _temp3.then ? _temp3.then(_temp4) : _temp4(_temp3);
|
|
3116
|
-
});
|
|
3117
|
-
}, function (error) {
|
|
3118
|
-
console.error('Failed to cleanup old months metadata:', error);
|
|
3119
|
-
}));
|
|
3120
|
-
} catch (e) {
|
|
3121
|
-
return Promise.reject(e);
|
|
3122
|
-
}
|
|
3123
|
-
};
|
|
3124
|
-
var getMetadata = function getMetadata(url) {
|
|
3125
|
-
return Promise.resolve(_catch(function () {
|
|
3126
|
-
var currentMonth = getCurrentMonthKey();
|
|
3127
|
-
return Promise.resolve(getDataFromDB(METADATA_DB_NAME, currentMonth, url, 'url')).then(function (result) {
|
|
3128
|
-
if (!result || typeof result === 'string') {
|
|
3129
|
-
return null;
|
|
3130
|
-
}
|
|
3131
|
-
var metadataRecord = result;
|
|
3132
|
-
return Date.now() > metadataRecord.expiresAt ? null : metadataRecord;
|
|
3133
|
-
});
|
|
3134
|
-
}, function () {
|
|
3135
|
-
return null;
|
|
3136
|
-
}));
|
|
3137
|
-
};
|
|
3138
|
-
|
|
3139
2686
|
var SceytChatClient = {};
|
|
3140
2687
|
var setClient = function setClient(client) {
|
|
3141
2688
|
SceytChatClient = client;
|
|
3142
|
-
cleanupOldMonthsMetadata();
|
|
3143
2689
|
};
|
|
3144
2690
|
var getClient = function getClient() {
|
|
3145
2691
|
return SceytChatClient;
|
|
@@ -10133,6 +9679,193 @@ var CHANNEL_EVENT_TYPES = {
|
|
|
10133
9679
|
UNFROZEN: 'UNFROZEN'
|
|
10134
9680
|
};
|
|
10135
9681
|
|
|
9682
|
+
// A type of promise-like that resolves synchronously and supports only one observer
|
|
9683
|
+
const _Pact = /*#__PURE__*/(function() {
|
|
9684
|
+
function _Pact() {}
|
|
9685
|
+
_Pact.prototype.then = function(onFulfilled, onRejected) {
|
|
9686
|
+
const result = new _Pact();
|
|
9687
|
+
const state = this.s;
|
|
9688
|
+
if (state) {
|
|
9689
|
+
const callback = state & 1 ? onFulfilled : onRejected;
|
|
9690
|
+
if (callback) {
|
|
9691
|
+
try {
|
|
9692
|
+
_settle(result, 1, callback(this.v));
|
|
9693
|
+
} catch (e) {
|
|
9694
|
+
_settle(result, 2, e);
|
|
9695
|
+
}
|
|
9696
|
+
return result;
|
|
9697
|
+
} else {
|
|
9698
|
+
return this;
|
|
9699
|
+
}
|
|
9700
|
+
}
|
|
9701
|
+
this.o = function(_this) {
|
|
9702
|
+
try {
|
|
9703
|
+
const value = _this.v;
|
|
9704
|
+
if (_this.s & 1) {
|
|
9705
|
+
_settle(result, 1, onFulfilled ? onFulfilled(value) : value);
|
|
9706
|
+
} else if (onRejected) {
|
|
9707
|
+
_settle(result, 1, onRejected(value));
|
|
9708
|
+
} else {
|
|
9709
|
+
_settle(result, 2, value);
|
|
9710
|
+
}
|
|
9711
|
+
} catch (e) {
|
|
9712
|
+
_settle(result, 2, e);
|
|
9713
|
+
}
|
|
9714
|
+
};
|
|
9715
|
+
return result;
|
|
9716
|
+
};
|
|
9717
|
+
return _Pact;
|
|
9718
|
+
})();
|
|
9719
|
+
|
|
9720
|
+
// Settles a pact synchronously
|
|
9721
|
+
function _settle(pact, state, value) {
|
|
9722
|
+
if (!pact.s) {
|
|
9723
|
+
if (value instanceof _Pact) {
|
|
9724
|
+
if (value.s) {
|
|
9725
|
+
if (state & 1) {
|
|
9726
|
+
state = value.s;
|
|
9727
|
+
}
|
|
9728
|
+
value = value.v;
|
|
9729
|
+
} else {
|
|
9730
|
+
value.o = _settle.bind(null, pact, state);
|
|
9731
|
+
return;
|
|
9732
|
+
}
|
|
9733
|
+
}
|
|
9734
|
+
if (value && value.then) {
|
|
9735
|
+
value.then(_settle.bind(null, pact, state), _settle.bind(null, pact, 2));
|
|
9736
|
+
return;
|
|
9737
|
+
}
|
|
9738
|
+
pact.s = state;
|
|
9739
|
+
pact.v = value;
|
|
9740
|
+
const observer = pact.o;
|
|
9741
|
+
if (observer) {
|
|
9742
|
+
observer(pact);
|
|
9743
|
+
}
|
|
9744
|
+
}
|
|
9745
|
+
}
|
|
9746
|
+
|
|
9747
|
+
function _isSettledPact(thenable) {
|
|
9748
|
+
return thenable instanceof _Pact && thenable.s & 1;
|
|
9749
|
+
}
|
|
9750
|
+
|
|
9751
|
+
// Asynchronously iterate through an object that has a length property, passing the index as the first argument to the callback (even as the length property changes)
|
|
9752
|
+
function _forTo(array, body, check) {
|
|
9753
|
+
var i = -1, pact, reject;
|
|
9754
|
+
function _cycle(result) {
|
|
9755
|
+
try {
|
|
9756
|
+
while (++i < array.length && (!check || !check())) {
|
|
9757
|
+
result = body(i);
|
|
9758
|
+
if (result && result.then) {
|
|
9759
|
+
if (_isSettledPact(result)) {
|
|
9760
|
+
result = result.v;
|
|
9761
|
+
} else {
|
|
9762
|
+
result.then(_cycle, reject || (reject = _settle.bind(null, pact = new _Pact(), 2)));
|
|
9763
|
+
return;
|
|
9764
|
+
}
|
|
9765
|
+
}
|
|
9766
|
+
}
|
|
9767
|
+
if (pact) {
|
|
9768
|
+
_settle(pact, 1, result);
|
|
9769
|
+
} else {
|
|
9770
|
+
pact = result;
|
|
9771
|
+
}
|
|
9772
|
+
} catch (e) {
|
|
9773
|
+
_settle(pact || (pact = new _Pact()), 2, e);
|
|
9774
|
+
}
|
|
9775
|
+
}
|
|
9776
|
+
_cycle();
|
|
9777
|
+
return pact;
|
|
9778
|
+
}
|
|
9779
|
+
|
|
9780
|
+
const _iteratorSymbol = /*#__PURE__*/ typeof Symbol !== "undefined" ? (Symbol.iterator || (Symbol.iterator = Symbol("Symbol.iterator"))) : "@@iterator";
|
|
9781
|
+
|
|
9782
|
+
// Asynchronously iterate through an object's values
|
|
9783
|
+
// Uses for...of if the runtime supports it, otherwise iterates until length on a copy
|
|
9784
|
+
function _forOf(target, body, check) {
|
|
9785
|
+
if (typeof target[_iteratorSymbol] === "function") {
|
|
9786
|
+
var iterator = target[_iteratorSymbol](), step, pact, reject;
|
|
9787
|
+
function _cycle(result) {
|
|
9788
|
+
try {
|
|
9789
|
+
while (!(step = iterator.next()).done && (!check || !check())) {
|
|
9790
|
+
result = body(step.value);
|
|
9791
|
+
if (result && result.then) {
|
|
9792
|
+
if (_isSettledPact(result)) {
|
|
9793
|
+
result = result.v;
|
|
9794
|
+
} else {
|
|
9795
|
+
result.then(_cycle, reject || (reject = _settle.bind(null, pact = new _Pact(), 2)));
|
|
9796
|
+
return;
|
|
9797
|
+
}
|
|
9798
|
+
}
|
|
9799
|
+
}
|
|
9800
|
+
if (pact) {
|
|
9801
|
+
_settle(pact, 1, result);
|
|
9802
|
+
} else {
|
|
9803
|
+
pact = result;
|
|
9804
|
+
}
|
|
9805
|
+
} catch (e) {
|
|
9806
|
+
_settle(pact || (pact = new _Pact()), 2, e);
|
|
9807
|
+
}
|
|
9808
|
+
}
|
|
9809
|
+
_cycle();
|
|
9810
|
+
if (iterator.return) {
|
|
9811
|
+
var _fixup = function(value) {
|
|
9812
|
+
try {
|
|
9813
|
+
if (!step.done) {
|
|
9814
|
+
iterator.return();
|
|
9815
|
+
}
|
|
9816
|
+
} catch(e) {
|
|
9817
|
+
}
|
|
9818
|
+
return value;
|
|
9819
|
+
};
|
|
9820
|
+
if (pact && pact.then) {
|
|
9821
|
+
return pact.then(_fixup, function(e) {
|
|
9822
|
+
throw _fixup(e);
|
|
9823
|
+
});
|
|
9824
|
+
}
|
|
9825
|
+
_fixup();
|
|
9826
|
+
}
|
|
9827
|
+
return pact;
|
|
9828
|
+
}
|
|
9829
|
+
// No support for Symbol.iterator
|
|
9830
|
+
if (!("length" in target)) {
|
|
9831
|
+
throw new TypeError("Object is not iterable");
|
|
9832
|
+
}
|
|
9833
|
+
// Handle live collections properly
|
|
9834
|
+
var values = [];
|
|
9835
|
+
for (var i = 0; i < target.length; i++) {
|
|
9836
|
+
values.push(target[i]);
|
|
9837
|
+
}
|
|
9838
|
+
return _forTo(values, function(i) { return body(values[i]); }, check);
|
|
9839
|
+
}
|
|
9840
|
+
|
|
9841
|
+
const _asyncIteratorSymbol = /*#__PURE__*/ typeof Symbol !== "undefined" ? (Symbol.asyncIterator || (Symbol.asyncIterator = Symbol("Symbol.asyncIterator"))) : "@@asyncIterator";
|
|
9842
|
+
|
|
9843
|
+
// Asynchronously call a function and send errors to recovery continuation
|
|
9844
|
+
function _catch(body, recover) {
|
|
9845
|
+
try {
|
|
9846
|
+
var result = body();
|
|
9847
|
+
} catch(e) {
|
|
9848
|
+
return recover(e);
|
|
9849
|
+
}
|
|
9850
|
+
if (result && result.then) {
|
|
9851
|
+
return result.then(void 0, recover);
|
|
9852
|
+
}
|
|
9853
|
+
return result;
|
|
9854
|
+
}
|
|
9855
|
+
|
|
9856
|
+
// Asynchronously await a promise and pass the result to a finally continuation
|
|
9857
|
+
function _finallyRethrows(body, finalizer) {
|
|
9858
|
+
try {
|
|
9859
|
+
var result = body();
|
|
9860
|
+
} catch (e) {
|
|
9861
|
+
return finalizer(true, e);
|
|
9862
|
+
}
|
|
9863
|
+
if (result && result.then) {
|
|
9864
|
+
return result.then(finalizer.bind(null, false), finalizer.bind(null, true));
|
|
9865
|
+
}
|
|
9866
|
+
return finalizer(false, result);
|
|
9867
|
+
}
|
|
9868
|
+
|
|
10136
9869
|
var CustomUploader;
|
|
10137
9870
|
var sendAttachmentsAsSeparateMessages = false;
|
|
10138
9871
|
var pendingUploaders = {};
|
|
@@ -11350,15 +11083,11 @@ function setUnreadMessageIdAC(messageId) {
|
|
|
11350
11083
|
messageId: messageId
|
|
11351
11084
|
});
|
|
11352
11085
|
}
|
|
11353
|
-
function loadOGMetadataForLinkAC(messages
|
|
11354
|
-
if (setStore === void 0) {
|
|
11355
|
-
setStore = false;
|
|
11356
|
-
}
|
|
11086
|
+
function loadOGMetadataForLinkAC(messages) {
|
|
11357
11087
|
return {
|
|
11358
11088
|
type: LOAD_OG_METADATA_FOR_LINK,
|
|
11359
11089
|
payload: {
|
|
11360
|
-
messages: messages
|
|
11361
|
-
setStore: setStore
|
|
11090
|
+
messages: messages
|
|
11362
11091
|
}
|
|
11363
11092
|
};
|
|
11364
11093
|
}
|
|
@@ -11380,15 +11109,11 @@ function refreshCacheAroundMessageAC(channelId, messageId, applyVisibleWindow) {
|
|
|
11380
11109
|
}
|
|
11381
11110
|
};
|
|
11382
11111
|
}
|
|
11383
|
-
function fetchOGMetadataForLinkAC(url
|
|
11384
|
-
if (setStore === void 0) {
|
|
11385
|
-
setStore = true;
|
|
11386
|
-
}
|
|
11112
|
+
function fetchOGMetadataForLinkAC(url) {
|
|
11387
11113
|
return {
|
|
11388
11114
|
type: FETCH_OG_METADATA,
|
|
11389
11115
|
payload: {
|
|
11390
|
-
url: url
|
|
11391
|
-
setStore: setStore
|
|
11116
|
+
url: url
|
|
11392
11117
|
}
|
|
11393
11118
|
};
|
|
11394
11119
|
}
|
|
@@ -15785,7 +15510,7 @@ function handleChannelMessageEvent(args, SceytChatClient) {
|
|
|
15785
15510
|
return effects.put(addMessagesAC([message], 'next'));
|
|
15786
15511
|
case 7:
|
|
15787
15512
|
_context.n = 8;
|
|
15788
|
-
return effects.put(loadOGMetadataForLinkAC([message]
|
|
15513
|
+
return effects.put(loadOGMetadataForLinkAC([message]));
|
|
15789
15514
|
case 8:
|
|
15790
15515
|
_context.n = 9;
|
|
15791
15516
|
return effects.select(browserTabIsActiveSelector);
|
|
@@ -22324,7 +22049,7 @@ function sendMessage(action) {
|
|
|
22324
22049
|
break;
|
|
22325
22050
|
}
|
|
22326
22051
|
_context11.n = 1;
|
|
22327
|
-
return effects.call(loadOGMetadataForLinkMessages, [_pending], true
|
|
22052
|
+
return effects.call(loadOGMetadataForLinkMessages, [_pending], true);
|
|
22328
22053
|
case 1:
|
|
22329
22054
|
_context11.n = 2;
|
|
22330
22055
|
return effects.call(updateMessage$1, action.type, _pending, channel.id, true, message);
|
|
@@ -22386,7 +22111,7 @@ function sendMessage(action) {
|
|
|
22386
22111
|
break;
|
|
22387
22112
|
}
|
|
22388
22113
|
_context13.n = 10;
|
|
22389
|
-
return effects.call(loadOGMetadataForLinkMessages, [pending], true
|
|
22114
|
+
return effects.call(loadOGMetadataForLinkMessages, [pending], true);
|
|
22390
22115
|
case 10:
|
|
22391
22116
|
_context13.n = 11;
|
|
22392
22117
|
return effects.call(updateMessage$1, action.type, pending, channel.id, true, message);
|
|
@@ -22600,7 +22325,7 @@ function sendMessage(action) {
|
|
|
22600
22325
|
}, _marked1$1, null, [[1, 16]]);
|
|
22601
22326
|
}
|
|
22602
22327
|
function sendTextMessage(action) {
|
|
22603
|
-
var payload, message, connectionState, channelId, channel, sendMessageTid, pendingMessage, SceytChatClient, createChannelData, mentionedUserIds, attachments, attachmentBuilder, att, messageBuilder, createdMessage, messageToSend, _getStoredChannel7, messageResponse, messageUpdateData, activeChannelId, stringifiedMessageUpdateData, messageToUpdate, resolvedLastMessage, channelUpdateParam, _channel2, isErrorResendable, _t3;
|
|
22328
|
+
var payload, message, connectionState, channelId, channel, sendMessageTid, pendingMessage, SceytChatClient, createChannelData, mentionedUserIds, attachments, _attachments$, attachmentBuilder, att, messageBuilder, createdMessage, messageToSend, _getStoredChannel7, messageResponse, messageUpdateData, activeChannelId, stringifiedMessageUpdateData, messageToUpdate, resolvedLastMessage, channelUpdateParam, _channel2, isErrorResendable, _t3;
|
|
22604
22329
|
return _regenerator().w(function (_context14) {
|
|
22605
22330
|
while (1) switch (_context14.p = _context14.n) {
|
|
22606
22331
|
case 0:
|
|
@@ -22653,7 +22378,7 @@ function sendTextMessage(action) {
|
|
|
22653
22378
|
if (message.attachments && message.attachments.length) {
|
|
22654
22379
|
attachmentBuilder = channel.createAttachmentBuilder(attachments[0].data, attachments[0].type);
|
|
22655
22380
|
attachmentBuilder.setMetadata(JSON.stringify(attachments[0].metadata));
|
|
22656
|
-
att = attachmentBuilder.setName('').setUpload(attachments[0].upload).create();
|
|
22381
|
+
att = attachmentBuilder.setName(((_attachments$ = attachments[0]) === null || _attachments$ === void 0 ? void 0 : _attachments$.name) || '').setUpload(attachments[0].upload).create();
|
|
22657
22382
|
attachments = [att];
|
|
22658
22383
|
}
|
|
22659
22384
|
messageBuilder = channel.createMessageBuilder();
|
|
@@ -22687,7 +22412,7 @@ function sendTextMessage(action) {
|
|
|
22687
22412
|
break;
|
|
22688
22413
|
}
|
|
22689
22414
|
_context14.n = 7;
|
|
22690
|
-
return effects.call(loadOGMetadataForLinkMessages, [pendingMessage], true
|
|
22415
|
+
return effects.call(loadOGMetadataForLinkMessages, [pendingMessage], true);
|
|
22691
22416
|
case 7:
|
|
22692
22417
|
_context14.n = 8;
|
|
22693
22418
|
return effects.call(updateMessage$1, action.type, pendingMessage, channel.id, true, message);
|
|
@@ -22886,7 +22611,7 @@ function forwardMessage(action) {
|
|
|
22886
22611
|
break;
|
|
22887
22612
|
}
|
|
22888
22613
|
_context15.n = 7;
|
|
22889
|
-
return effects.call(loadOGMetadataForLinkMessages, [pendingMessage], true
|
|
22614
|
+
return effects.call(loadOGMetadataForLinkMessages, [pendingMessage], true);
|
|
22890
22615
|
case 7:
|
|
22891
22616
|
_context15.n = 8;
|
|
22892
22617
|
return effects.call(updateMessage$1, action.type, pendingMessage, channel.id, channelId === activeChannelId, message, isNotShowOwnMessageForward);
|
|
@@ -23456,7 +23181,7 @@ function loadFromMetadata(firstAttachment) {
|
|
|
23456
23181
|
compactMeta = JSON.parse(firstAttachment.metadata);
|
|
23457
23182
|
fullMetadata = {
|
|
23458
23183
|
og: {
|
|
23459
|
-
title: compactMeta.ttl,
|
|
23184
|
+
title: compactMeta.ttl || (firstAttachment === null || firstAttachment === void 0 ? void 0 : firstAttachment.name),
|
|
23460
23185
|
description: compactMeta.dsc,
|
|
23461
23186
|
image: compactMeta.iur ? [{
|
|
23462
23187
|
url: compactMeta.iur
|
|
@@ -23475,17 +23200,14 @@ function loadFromMetadata(firstAttachment) {
|
|
|
23475
23200
|
}
|
|
23476
23201
|
}, _marked16$1);
|
|
23477
23202
|
}
|
|
23478
|
-
function loadOGMetadataForLinkMessages(messages,
|
|
23479
|
-
if (setStore === void 0) {
|
|
23480
|
-
setStore = true;
|
|
23481
|
-
}
|
|
23203
|
+
function loadOGMetadataForLinkMessages(messages, getFromServer) {
|
|
23482
23204
|
if (getFromServer === void 0) {
|
|
23483
23205
|
getFromServer = true;
|
|
23484
23206
|
}
|
|
23485
23207
|
return /*#__PURE__*/_regenerator().m(function _callee6() {
|
|
23486
|
-
var i, _message$attachments2, message, isOnlyLinkAttachments, firstAttachment, j, _attachment, _firstAttachment, _store$getState$Messa, _firstAttachment2, _firstAttachment3, _firstAttachment4, metadata, storedData
|
|
23208
|
+
var i, _message$attachments2, message, isOnlyLinkAttachments, firstAttachment, j, _attachment, _firstAttachment, _store$getState$Messa, _firstAttachment2, _firstAttachment3, _firstAttachment4, metadata, storedData;
|
|
23487
23209
|
return _regenerator().w(function (_context22) {
|
|
23488
|
-
while (1) switch (_context22.
|
|
23210
|
+
while (1) switch (_context22.n) {
|
|
23489
23211
|
case 0:
|
|
23490
23212
|
if (!(!messages || messages.length === 0)) {
|
|
23491
23213
|
_context22.n = 1;
|
|
@@ -23496,12 +23218,12 @@ function loadOGMetadataForLinkMessages(messages, setStore, sendMessage, getFromS
|
|
|
23496
23218
|
i = 0;
|
|
23497
23219
|
case 2:
|
|
23498
23220
|
if (!(i < messages.length)) {
|
|
23499
|
-
_context22.n =
|
|
23221
|
+
_context22.n = 11;
|
|
23500
23222
|
break;
|
|
23501
23223
|
}
|
|
23502
23224
|
message = messages[i];
|
|
23503
23225
|
if (!(message !== null && message !== void 0 && (_message$attachments2 = message.attachments) !== null && _message$attachments2 !== void 0 && _message$attachments2.length)) {
|
|
23504
|
-
_context22.n =
|
|
23226
|
+
_context22.n = 10;
|
|
23505
23227
|
break;
|
|
23506
23228
|
}
|
|
23507
23229
|
isOnlyLinkAttachments = true;
|
|
@@ -23531,7 +23253,7 @@ function loadOGMetadataForLinkMessages(messages, setStore, sendMessage, getFromS
|
|
|
23531
23253
|
break;
|
|
23532
23254
|
case 6:
|
|
23533
23255
|
if (!(isOnlyLinkAttachments && firstAttachment)) {
|
|
23534
|
-
_context22.n =
|
|
23256
|
+
_context22.n = 10;
|
|
23535
23257
|
break;
|
|
23536
23258
|
}
|
|
23537
23259
|
if (!((_firstAttachment = firstAttachment) !== null && _firstAttachment !== void 0 && _firstAttachment.metadata)) {
|
|
@@ -23543,73 +23265,40 @@ function loadOGMetadataForLinkMessages(messages, setStore, sendMessage, getFromS
|
|
|
23543
23265
|
_context22.n = 7;
|
|
23544
23266
|
break;
|
|
23545
23267
|
}
|
|
23546
|
-
return _context22.a(3,
|
|
23268
|
+
return _context22.a(3, 10);
|
|
23547
23269
|
case 7:
|
|
23548
23270
|
storedData = (_store$getState$Messa = store.getState().MessageReducer.oGMetadata) === null || _store$getState$Messa === void 0 ? void 0 : _store$getState$Messa[firstAttachment.url];
|
|
23549
23271
|
if (!storedData) {
|
|
23550
|
-
_context22.n = 9;
|
|
23551
|
-
break;
|
|
23552
|
-
}
|
|
23553
|
-
if (!sendMessage) {
|
|
23554
23272
|
_context22.n = 8;
|
|
23555
23273
|
break;
|
|
23556
23274
|
}
|
|
23557
|
-
|
|
23558
|
-
_context22.n = 8;
|
|
23559
|
-
break;
|
|
23560
|
-
}
|
|
23561
|
-
_context22.n = 8;
|
|
23562
|
-
return effects.call(storeMetadata, firstAttachment.url, storedData);
|
|
23275
|
+
return _context22.a(3, 10);
|
|
23563
23276
|
case 8:
|
|
23564
|
-
|
|
23565
|
-
case 9:
|
|
23566
|
-
_context22.p = 9;
|
|
23567
|
-
_context22.n = 10;
|
|
23568
|
-
return effects.call(getMetadata, firstAttachment.url);
|
|
23569
|
-
case 10:
|
|
23570
|
-
cachedMetadata = _context22.v;
|
|
23571
|
-
if (!cachedMetadata) {
|
|
23572
|
-
_context22.n = 12;
|
|
23573
|
-
break;
|
|
23574
|
-
}
|
|
23575
|
-
_context22.n = 11;
|
|
23576
|
-
return effects.put(setOGMetadataAC(firstAttachment.url, cachedMetadata));
|
|
23577
|
-
case 11:
|
|
23578
|
-
_context22.n = 13;
|
|
23579
|
-
break;
|
|
23580
|
-
case 12:
|
|
23581
|
-
_context22.n = 13;
|
|
23582
|
-
return effects.call(loadFromMetadata, firstAttachment);
|
|
23583
|
-
case 13:
|
|
23584
|
-
_context22.n = 15;
|
|
23585
|
-
break;
|
|
23586
|
-
case 14:
|
|
23587
|
-
_context22.p = 14;
|
|
23588
|
-
_context22.n = 15;
|
|
23277
|
+
_context22.n = 9;
|
|
23589
23278
|
return effects.call(loadFromMetadata, firstAttachment);
|
|
23590
|
-
case
|
|
23279
|
+
case 9:
|
|
23591
23280
|
if (getFromServer) {
|
|
23592
|
-
store.dispatch(fetchOGMetadataForLinkAC(firstAttachment.url
|
|
23281
|
+
store.dispatch(fetchOGMetadataForLinkAC(firstAttachment.url));
|
|
23593
23282
|
}
|
|
23594
|
-
case
|
|
23283
|
+
case 10:
|
|
23595
23284
|
i++;
|
|
23596
23285
|
_context22.n = 2;
|
|
23597
23286
|
break;
|
|
23598
|
-
case
|
|
23287
|
+
case 11:
|
|
23599
23288
|
return _context22.a(2);
|
|
23600
23289
|
}
|
|
23601
|
-
}, _callee6
|
|
23290
|
+
}, _callee6);
|
|
23602
23291
|
})();
|
|
23603
23292
|
}
|
|
23604
23293
|
function fetchOGMetadata(action) {
|
|
23605
|
-
var
|
|
23294
|
+
var url, client, _metadata$og, _metadata$og$image, _metadata$og$image$, queryBuilder, _query, metadata, imageUrl, imageDimensions, metadataWithImage, _metadata$og2, _metadata$og2$favicon, faviconUrl, metadataWithFavicon, _metadataWithFavicon, _metadata$og3, _metadata$og3$favicon, _faviconUrl, _metadataWithFavicon2, _metadataWithFavicon3;
|
|
23606
23295
|
return _regenerator().w(function (_context23) {
|
|
23607
23296
|
while (1) switch (_context23.p = _context23.n) {
|
|
23608
23297
|
case 0:
|
|
23609
|
-
|
|
23298
|
+
url = action.payload.url;
|
|
23610
23299
|
client = getClient();
|
|
23611
23300
|
if (!(client && client.connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
23612
|
-
_context23.n =
|
|
23301
|
+
_context23.n = 22;
|
|
23613
23302
|
break;
|
|
23614
23303
|
}
|
|
23615
23304
|
_context23.p = 1;
|
|
@@ -23624,14 +23313,10 @@ function fetchOGMetadata(action) {
|
|
|
23624
23313
|
metadata = _context23.v;
|
|
23625
23314
|
imageUrl = metadata === null || metadata === void 0 ? void 0 : (_metadata$og = metadata.og) === null || _metadata$og === void 0 ? void 0 : (_metadata$og$image = _metadata$og.image) === null || _metadata$og$image === void 0 ? void 0 : (_metadata$og$image$ = _metadata$og$image[0]) === null || _metadata$og$image$ === void 0 ? void 0 : _metadata$og$image$.url;
|
|
23626
23315
|
if (!imageUrl) {
|
|
23627
|
-
_context23.n =
|
|
23316
|
+
_context23.n = 13;
|
|
23628
23317
|
break;
|
|
23629
23318
|
}
|
|
23630
23319
|
_context23.p = 4;
|
|
23631
|
-
if (!setStore) {
|
|
23632
|
-
_context23.n = 6;
|
|
23633
|
-
break;
|
|
23634
|
-
}
|
|
23635
23320
|
_context23.n = 5;
|
|
23636
23321
|
return effects.call(loadImage, imageUrl);
|
|
23637
23322
|
case 5:
|
|
@@ -23640,128 +23325,81 @@ function fetchOGMetadata(action) {
|
|
|
23640
23325
|
imageWidth: imageDimensions.width,
|
|
23641
23326
|
imageHeight: imageDimensions.height
|
|
23642
23327
|
});
|
|
23643
|
-
_context23.n =
|
|
23644
|
-
break;
|
|
23645
|
-
case 6:
|
|
23646
|
-
metadataWithImage = metadata;
|
|
23647
|
-
case 7:
|
|
23648
|
-
_context23.n = 8;
|
|
23328
|
+
_context23.n = 6;
|
|
23649
23329
|
return effects.put(setOGMetadataAC(url, metadataWithImage));
|
|
23650
|
-
case
|
|
23651
|
-
|
|
23652
|
-
_context23.n = 9;
|
|
23653
|
-
break;
|
|
23654
|
-
}
|
|
23655
|
-
_context23.n = 9;
|
|
23656
|
-
return effects.call(storeMetadata, url, metadataWithImage);
|
|
23657
|
-
case 9:
|
|
23658
|
-
_context23.n = 17;
|
|
23330
|
+
case 6:
|
|
23331
|
+
_context23.n = 12;
|
|
23659
23332
|
break;
|
|
23660
|
-
case
|
|
23661
|
-
_context23.p =
|
|
23333
|
+
case 7:
|
|
23334
|
+
_context23.p = 7;
|
|
23662
23335
|
faviconUrl = metadata === null || metadata === void 0 ? void 0 : (_metadata$og2 = metadata.og) === null || _metadata$og2 === void 0 ? void 0 : (_metadata$og2$favicon = _metadata$og2.favicon) === null || _metadata$og2$favicon === void 0 ? void 0 : _metadata$og2$favicon.url;
|
|
23663
23336
|
if (!faviconUrl) {
|
|
23664
|
-
_context23.n =
|
|
23337
|
+
_context23.n = 12;
|
|
23665
23338
|
break;
|
|
23666
23339
|
}
|
|
23667
|
-
_context23.p =
|
|
23668
|
-
_context23.n =
|
|
23340
|
+
_context23.p = 8;
|
|
23341
|
+
_context23.n = 9;
|
|
23669
23342
|
return effects.call(loadImage, faviconUrl);
|
|
23670
|
-
case
|
|
23343
|
+
case 9:
|
|
23671
23344
|
metadataWithFavicon = _extends({}, metadata, {
|
|
23672
23345
|
faviconLoaded: true
|
|
23673
23346
|
});
|
|
23674
|
-
_context23.n =
|
|
23347
|
+
_context23.n = 10;
|
|
23675
23348
|
return effects.put(setOGMetadataAC(url, metadataWithFavicon));
|
|
23676
|
-
case
|
|
23677
|
-
|
|
23678
|
-
_context23.n = 14;
|
|
23679
|
-
break;
|
|
23680
|
-
}
|
|
23681
|
-
_context23.n = 14;
|
|
23682
|
-
return effects.call(storeMetadata, url, metadataWithFavicon);
|
|
23683
|
-
case 14:
|
|
23684
|
-
_context23.n = 17;
|
|
23349
|
+
case 10:
|
|
23350
|
+
_context23.n = 12;
|
|
23685
23351
|
break;
|
|
23686
|
-
case
|
|
23687
|
-
_context23.p =
|
|
23352
|
+
case 11:
|
|
23353
|
+
_context23.p = 11;
|
|
23688
23354
|
_metadataWithFavicon = _extends({}, metadata, {
|
|
23689
23355
|
faviconLoaded: false
|
|
23690
23356
|
});
|
|
23691
|
-
_context23.n =
|
|
23357
|
+
_context23.n = 12;
|
|
23692
23358
|
return effects.put(setOGMetadataAC(url, _metadataWithFavicon));
|
|
23693
|
-
case
|
|
23694
|
-
|
|
23695
|
-
_context23.n = 17;
|
|
23696
|
-
break;
|
|
23697
|
-
}
|
|
23698
|
-
_context23.n = 17;
|
|
23699
|
-
return effects.call(storeMetadata, url, _metadataWithFavicon);
|
|
23700
|
-
case 17:
|
|
23701
|
-
_context23.n = 28;
|
|
23359
|
+
case 12:
|
|
23360
|
+
_context23.n = 20;
|
|
23702
23361
|
break;
|
|
23703
|
-
case
|
|
23362
|
+
case 13:
|
|
23704
23363
|
_faviconUrl = metadata === null || metadata === void 0 ? void 0 : (_metadata$og3 = metadata.og) === null || _metadata$og3 === void 0 ? void 0 : (_metadata$og3$favicon = _metadata$og3.favicon) === null || _metadata$og3$favicon === void 0 ? void 0 : _metadata$og3$favicon.url;
|
|
23705
23364
|
if (!_faviconUrl) {
|
|
23706
|
-
_context23.n =
|
|
23365
|
+
_context23.n = 19;
|
|
23707
23366
|
break;
|
|
23708
23367
|
}
|
|
23709
|
-
_context23.p =
|
|
23710
|
-
_context23.n =
|
|
23368
|
+
_context23.p = 14;
|
|
23369
|
+
_context23.n = 15;
|
|
23711
23370
|
return effects.call(loadImage, _faviconUrl);
|
|
23712
|
-
case
|
|
23371
|
+
case 15:
|
|
23713
23372
|
_metadataWithFavicon2 = _extends({}, metadata, {
|
|
23714
23373
|
faviconLoaded: true
|
|
23715
23374
|
});
|
|
23716
|
-
_context23.n =
|
|
23375
|
+
_context23.n = 16;
|
|
23717
23376
|
return effects.put(setOGMetadataAC(url, _metadataWithFavicon2));
|
|
23718
|
-
case
|
|
23719
|
-
|
|
23720
|
-
_context23.n = 22;
|
|
23721
|
-
break;
|
|
23722
|
-
}
|
|
23723
|
-
_context23.n = 22;
|
|
23724
|
-
return effects.call(storeMetadata, url, _metadataWithFavicon2);
|
|
23725
|
-
case 22:
|
|
23726
|
-
_context23.n = 25;
|
|
23377
|
+
case 16:
|
|
23378
|
+
_context23.n = 18;
|
|
23727
23379
|
break;
|
|
23728
|
-
case
|
|
23729
|
-
_context23.p =
|
|
23380
|
+
case 17:
|
|
23381
|
+
_context23.p = 17;
|
|
23730
23382
|
_metadataWithFavicon3 = _extends({}, metadata, {
|
|
23731
23383
|
faviconLoaded: false
|
|
23732
23384
|
});
|
|
23733
|
-
_context23.n =
|
|
23385
|
+
_context23.n = 18;
|
|
23734
23386
|
return effects.put(setOGMetadataAC(url, _metadataWithFavicon3));
|
|
23735
|
-
case
|
|
23736
|
-
|
|
23737
|
-
_context23.n = 25;
|
|
23738
|
-
break;
|
|
23739
|
-
}
|
|
23740
|
-
_context23.n = 25;
|
|
23741
|
-
return effects.call(storeMetadata, url, _metadataWithFavicon3);
|
|
23742
|
-
case 25:
|
|
23743
|
-
_context23.n = 28;
|
|
23387
|
+
case 18:
|
|
23388
|
+
_context23.n = 20;
|
|
23744
23389
|
break;
|
|
23745
|
-
case
|
|
23746
|
-
_context23.n =
|
|
23390
|
+
case 19:
|
|
23391
|
+
_context23.n = 20;
|
|
23747
23392
|
return effects.put(setOGMetadataAC(url, metadata));
|
|
23748
|
-
case
|
|
23749
|
-
|
|
23750
|
-
_context23.n = 28;
|
|
23751
|
-
break;
|
|
23752
|
-
}
|
|
23753
|
-
_context23.n = 28;
|
|
23754
|
-
return effects.call(storeMetadata, url, metadata);
|
|
23755
|
-
case 28:
|
|
23756
|
-
_context23.n = 30;
|
|
23393
|
+
case 20:
|
|
23394
|
+
_context23.n = 22;
|
|
23757
23395
|
break;
|
|
23758
|
-
case
|
|
23759
|
-
_context23.p =
|
|
23396
|
+
case 21:
|
|
23397
|
+
_context23.p = 21;
|
|
23760
23398
|
console.log('Failed to fetch OG metadata', url);
|
|
23761
|
-
case
|
|
23399
|
+
case 22:
|
|
23762
23400
|
return _context23.a(2);
|
|
23763
23401
|
}
|
|
23764
|
-
}, _marked17$1, null, [[
|
|
23402
|
+
}, _marked17$1, null, [[14, 17], [8, 11], [4, 7], [1, 21]]);
|
|
23765
23403
|
}
|
|
23766
23404
|
function loadImage(src) {
|
|
23767
23405
|
return new Promise(function (resolve, reject) {
|
|
@@ -23782,25 +23420,25 @@ function loadImage(src) {
|
|
|
23782
23420
|
});
|
|
23783
23421
|
}
|
|
23784
23422
|
function loadOGMetadataForLinkSaga(action) {
|
|
23785
|
-
var
|
|
23423
|
+
var messages;
|
|
23786
23424
|
return _regenerator().w(function (_context24) {
|
|
23787
23425
|
while (1) switch (_context24.n) {
|
|
23788
23426
|
case 0:
|
|
23789
|
-
|
|
23427
|
+
messages = action.payload.messages;
|
|
23790
23428
|
_context24.n = 1;
|
|
23791
|
-
return effects.call(loadOGMetadataForLinkMessages, messages
|
|
23429
|
+
return effects.call(loadOGMetadataForLinkMessages, messages);
|
|
23792
23430
|
case 1:
|
|
23793
23431
|
return _context24.a(2);
|
|
23794
23432
|
}
|
|
23795
23433
|
}, _marked18$1);
|
|
23796
23434
|
}
|
|
23797
23435
|
function reloadActiveChannelAfterReconnect(action) {
|
|
23798
|
-
var _store$getState$Chann2, _reconnectChannel, _action$
|
|
23436
|
+
var _store$getState$Chann2, _reconnectChannel, _action$payload2, channel, _action$payload2$visi, visibleAnchorId, _action$payload2$wasV, wasViewingLatest, _action$payload2$appl, applyVisibleWindow, _action$payload2$isAt, isAtHistoryTop, reconnectChannel, initialSignature, sawChannelsLoading, elapsed, _store$getState$Chann3, snapshot, snapshotSignature, resolvedChannelUpdateData, channelsLoadingState, _resolvedChannelUpdateData, latestSnapshot, _resolvedChannelUpdateData2, reloadAction, _t12;
|
|
23799
23437
|
return _regenerator().w(function (_context25) {
|
|
23800
23438
|
while (1) switch (_context25.p = _context25.n) {
|
|
23801
23439
|
case 0:
|
|
23802
23440
|
_context25.p = 0;
|
|
23803
|
-
_action$
|
|
23441
|
+
_action$payload2 = action.payload, channel = _action$payload2.channel, _action$payload2$visi = _action$payload2.visibleAnchorId, visibleAnchorId = _action$payload2$visi === void 0 ? '' : _action$payload2$visi, _action$payload2$wasV = _action$payload2.wasViewingLatest, wasViewingLatest = _action$payload2$wasV === void 0 ? false : _action$payload2$wasV, _action$payload2$appl = _action$payload2.applyVisibleWindow, applyVisibleWindow = _action$payload2$appl === void 0 ? true : _action$payload2$appl, _action$payload2$isAt = _action$payload2.isAtHistoryTop, isAtHistoryTop = _action$payload2$isAt === void 0 ? false : _action$payload2$isAt;
|
|
23804
23442
|
if (!(!(channel !== null && channel !== void 0 && channel.id) || channel !== null && channel !== void 0 && channel.isMockChannel || !isChannelStillActive(channel.id))) {
|
|
23805
23443
|
_context25.n = 1;
|
|
23806
23444
|
break;
|
|
@@ -23885,15 +23523,15 @@ function reloadActiveChannelAfterReconnect(action) {
|
|
|
23885
23523
|
break;
|
|
23886
23524
|
case 11:
|
|
23887
23525
|
_context25.p = 11;
|
|
23888
|
-
|
|
23889
|
-
log.error('error in reload active channel after reconnect',
|
|
23526
|
+
_t12 = _context25.v;
|
|
23527
|
+
log.error('error in reload active channel after reconnect', _t12);
|
|
23890
23528
|
case 12:
|
|
23891
23529
|
return _context25.a(2);
|
|
23892
23530
|
}
|
|
23893
23531
|
}, _marked19$1, null, [[0, 11]]);
|
|
23894
23532
|
}
|
|
23895
23533
|
function loadAroundMessageFromServer(channel, anchorId, prevCount, nextCount, connectionState) {
|
|
23896
|
-
var SceytChatClient, messageQueryBuilder, messageQuery, firstResult, pivotId, secondResult, resultMessages, firstConfirmedMessageId, lastConfirmedMessageId, appliedMessages, filteredPendingMessages, waitToSendPendingMessages, _t14, _t15
|
|
23534
|
+
var SceytChatClient, messageQueryBuilder, messageQuery, firstResult, pivotId, secondResult, resultMessages, firstConfirmedMessageId, lastConfirmedMessageId, appliedMessages, filteredPendingMessages, waitToSendPendingMessages, _t13, _t14, _t15;
|
|
23897
23535
|
return _regenerator().w(function (_context26) {
|
|
23898
23536
|
while (1) switch (_context26.n) {
|
|
23899
23537
|
case 0:
|
|
@@ -23908,13 +23546,13 @@ function loadAroundMessageFromServer(channel, anchorId, prevCount, nextCount, co
|
|
|
23908
23546
|
_context26.n = 1;
|
|
23909
23547
|
return effects.call(messageQueryBuilder.build);
|
|
23910
23548
|
case 1:
|
|
23911
|
-
|
|
23549
|
+
_t13 = _context26.v;
|
|
23912
23550
|
_context26.n = 3;
|
|
23913
23551
|
break;
|
|
23914
23552
|
case 2:
|
|
23915
|
-
|
|
23553
|
+
_t13 = null;
|
|
23916
23554
|
case 3:
|
|
23917
|
-
messageQuery =
|
|
23555
|
+
messageQuery = _t13;
|
|
23918
23556
|
query.messageQuery = messageQuery;
|
|
23919
23557
|
messageQuery.limit = prevCount || MESSAGES_MAX_PAGE_COUNT / 2;
|
|
23920
23558
|
if (!(anchorId && connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
@@ -23924,16 +23562,16 @@ function loadAroundMessageFromServer(channel, anchorId, prevCount, nextCount, co
|
|
|
23924
23562
|
_context26.n = 4;
|
|
23925
23563
|
return effects.call(messageQuery.loadPreviousMessageId, anchorId);
|
|
23926
23564
|
case 4:
|
|
23927
|
-
|
|
23565
|
+
_t14 = _context26.v;
|
|
23928
23566
|
_context26.n = 6;
|
|
23929
23567
|
break;
|
|
23930
23568
|
case 5:
|
|
23931
|
-
|
|
23569
|
+
_t14 = {
|
|
23932
23570
|
messages: [],
|
|
23933
23571
|
hasNext: false
|
|
23934
23572
|
};
|
|
23935
23573
|
case 6:
|
|
23936
|
-
firstResult =
|
|
23574
|
+
firstResult = _t14;
|
|
23937
23575
|
pivotId = firstResult.messages.length > 0 ? getLastConfirmedMessageId(firstResult.messages) : anchorId || '0';
|
|
23938
23576
|
messageQuery.reverse = false;
|
|
23939
23577
|
messageQuery.limit = nextCount || MESSAGES_MAX_PAGE_COUNT / 2;
|
|
@@ -23944,16 +23582,16 @@ function loadAroundMessageFromServer(channel, anchorId, prevCount, nextCount, co
|
|
|
23944
23582
|
_context26.n = 7;
|
|
23945
23583
|
return effects.call(messageQuery.loadNextMessageId, pivotId);
|
|
23946
23584
|
case 7:
|
|
23947
|
-
|
|
23585
|
+
_t15 = _context26.v;
|
|
23948
23586
|
_context26.n = 9;
|
|
23949
23587
|
break;
|
|
23950
23588
|
case 8:
|
|
23951
|
-
|
|
23589
|
+
_t15 = {
|
|
23952
23590
|
messages: [],
|
|
23953
23591
|
hasNext: false
|
|
23954
23592
|
};
|
|
23955
23593
|
case 9:
|
|
23956
|
-
secondResult =
|
|
23594
|
+
secondResult = _t15;
|
|
23957
23595
|
resultMessages = [].concat(firstResult.messages, secondResult.messages);
|
|
23958
23596
|
firstConfirmedMessageId = getFirstConfirmedMessageId(resultMessages);
|
|
23959
23597
|
lastConfirmedMessageId = getLastConfirmedMessageId(resultMessages);
|
|
@@ -23971,7 +23609,7 @@ function loadAroundMessageFromServer(channel, anchorId, prevCount, nextCount, co
|
|
|
23971
23609
|
case 11:
|
|
23972
23610
|
appliedMessages = getCachedMessagesForResult(channel.id, resultMessages);
|
|
23973
23611
|
_context26.n = 12;
|
|
23974
|
-
return effects.call(loadOGMetadataForLinkMessages, appliedMessages, true
|
|
23612
|
+
return effects.call(loadOGMetadataForLinkMessages, appliedMessages, true);
|
|
23975
23613
|
case 12:
|
|
23976
23614
|
_context26.n = 13;
|
|
23977
23615
|
return effects.put(setMessagesAC(JSON.parse(JSON.stringify(appliedMessages)), channel.id));
|
|
@@ -23984,7 +23622,7 @@ function loadAroundMessageFromServer(channel, anchorId, prevCount, nextCount, co
|
|
|
23984
23622
|
return effects.put(addMessagesAC(filteredPendingMessages, MESSAGE_LOAD_DIRECTION.NEXT));
|
|
23985
23623
|
case 15:
|
|
23986
23624
|
_context26.n = 16;
|
|
23987
|
-
return effects.call(loadOGMetadataForLinkMessages, filteredPendingMessages, true
|
|
23625
|
+
return effects.call(loadOGMetadataForLinkMessages, filteredPendingMessages, true);
|
|
23988
23626
|
case 16:
|
|
23989
23627
|
waitToSendPendingMessages = store.getState().UserReducer.waitToSendPendingMessages;
|
|
23990
23628
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED && waitToSendPendingMessages)) {
|
|
@@ -24002,7 +23640,7 @@ function loadAroundMessageFromServer(channel, anchorId, prevCount, nextCount, co
|
|
|
24002
23640
|
}, _marked20$1);
|
|
24003
23641
|
}
|
|
24004
23642
|
function backgroundRefreshRestoreWindow(channel, restoreWindow, cachedMessages) {
|
|
24005
|
-
var connectionState, SceytChatClient, messageQueryBuilder, messageQuery, prevResult, pivotId, nextResult, refreshedMessages, firstId, lastId, cachedConfirmed, changedMessages, appliedMessages, filteredPendingMessages, _t17, _t18
|
|
23643
|
+
var connectionState, SceytChatClient, messageQueryBuilder, messageQuery, prevResult, pivotId, nextResult, refreshedMessages, firstId, lastId, cachedConfirmed, changedMessages, appliedMessages, filteredPendingMessages, _t16, _t17, _t18;
|
|
24006
23644
|
return _regenerator().w(function (_context27) {
|
|
24007
23645
|
while (1) switch (_context27.p = _context27.n) {
|
|
24008
23646
|
case 0:
|
|
@@ -24036,16 +23674,16 @@ function backgroundRefreshRestoreWindow(channel, restoreWindow, cachedMessages)
|
|
|
24036
23674
|
_context27.n = 4;
|
|
24037
23675
|
return effects.call(messageQuery.loadPreviousMessageId, restoreWindow.anchorId);
|
|
24038
23676
|
case 4:
|
|
24039
|
-
|
|
23677
|
+
_t16 = _context27.v;
|
|
24040
23678
|
_context27.n = 6;
|
|
24041
23679
|
break;
|
|
24042
23680
|
case 5:
|
|
24043
|
-
|
|
23681
|
+
_t16 = {
|
|
24044
23682
|
messages: [],
|
|
24045
23683
|
hasNext: false
|
|
24046
23684
|
};
|
|
24047
23685
|
case 6:
|
|
24048
|
-
prevResult =
|
|
23686
|
+
prevResult = _t16;
|
|
24049
23687
|
pivotId = prevResult.messages.length > 0 ? getLastConfirmedMessageId(prevResult.messages) : restoreWindow.anchorId || '0';
|
|
24050
23688
|
messageQuery.reverse = false;
|
|
24051
23689
|
messageQuery.limit = restoreWindow.nextCount || MESSAGES_MAX_PAGE_COUNT / 2;
|
|
@@ -24056,16 +23694,16 @@ function backgroundRefreshRestoreWindow(channel, restoreWindow, cachedMessages)
|
|
|
24056
23694
|
_context27.n = 7;
|
|
24057
23695
|
return effects.call(messageQuery.loadNextMessageId, pivotId);
|
|
24058
23696
|
case 7:
|
|
24059
|
-
|
|
23697
|
+
_t17 = _context27.v;
|
|
24060
23698
|
_context27.n = 9;
|
|
24061
23699
|
break;
|
|
24062
23700
|
case 8:
|
|
24063
|
-
|
|
23701
|
+
_t17 = {
|
|
24064
23702
|
messages: [],
|
|
24065
23703
|
hasNext: false
|
|
24066
23704
|
};
|
|
24067
23705
|
case 9:
|
|
24068
|
-
nextResult =
|
|
23706
|
+
nextResult = _t17;
|
|
24069
23707
|
refreshedMessages = [].concat(prevResult.messages, nextResult.messages);
|
|
24070
23708
|
if (refreshedMessages.length) {
|
|
24071
23709
|
_context27.n = 10;
|
|
@@ -24080,7 +23718,7 @@ function backgroundRefreshRestoreWindow(channel, restoreWindow, cachedMessages)
|
|
|
24080
23718
|
setActiveSegment(channel.id, firstId, lastId);
|
|
24081
23719
|
}
|
|
24082
23720
|
_context27.n = 11;
|
|
24083
|
-
return effects.call(loadOGMetadataForLinkMessages, refreshedMessages, true
|
|
23721
|
+
return effects.call(loadOGMetadataForLinkMessages, refreshedMessages, true);
|
|
24084
23722
|
case 11:
|
|
24085
23723
|
if (isChannelStillActive(channel.id)) {
|
|
24086
23724
|
_context27.n = 12;
|
|
@@ -24118,26 +23756,26 @@ function backgroundRefreshRestoreWindow(channel, restoreWindow, cachedMessages)
|
|
|
24118
23756
|
return effects.put(addMessagesAC(filteredPendingMessages, MESSAGE_LOAD_DIRECTION.NEXT));
|
|
24119
23757
|
case 17:
|
|
24120
23758
|
_context27.n = 18;
|
|
24121
|
-
return effects.call(loadOGMetadataForLinkMessages, filteredPendingMessages, true
|
|
23759
|
+
return effects.call(loadOGMetadataForLinkMessages, filteredPendingMessages, true);
|
|
24122
23760
|
case 18:
|
|
24123
23761
|
_context27.n = 20;
|
|
24124
23762
|
break;
|
|
24125
23763
|
case 19:
|
|
24126
23764
|
_context27.p = 19;
|
|
24127
|
-
|
|
24128
|
-
log.error('error in backgroundRefreshRestoreWindow',
|
|
23765
|
+
_t18 = _context27.v;
|
|
23766
|
+
log.error('error in backgroundRefreshRestoreWindow', _t18);
|
|
24129
23767
|
case 20:
|
|
24130
23768
|
return _context27.a(2);
|
|
24131
23769
|
}
|
|
24132
23770
|
}, _marked21$1, null, [[0, 19]]);
|
|
24133
23771
|
}
|
|
24134
23772
|
function loadAroundMessageWorker(action) {
|
|
24135
|
-
var _action$
|
|
23773
|
+
var _action$payload3, channel, messageId, networkChanged, restoreWindow, connectionState, messages, cachedWindow, _filteredPendingMessages, cachedAroundWindow, _firstConfirmedMessageId, _lastConfirmedMessageId, _filteredPendingMessages2, _waitToSendPendingMessages, SceytChatClient, messageQueryBuilder, messageQuery, loadNextMessageId, loadPreviousMessageId, nextLoadLimit, previousLoadLimit, centerMessageIndex, firstResult, secondResult, resultMessages, result, firstConfirmedMessageId, lastConfirmedMessageId, appliedMessages, filteredPendingMessages, waitToSendPendingMessages, _t19, _t20, _t21;
|
|
24136
23774
|
return _regenerator().w(function (_context28) {
|
|
24137
23775
|
while (1) switch (_context28.p = _context28.n) {
|
|
24138
23776
|
case 0:
|
|
24139
23777
|
_context28.p = 0;
|
|
24140
|
-
_action$
|
|
23778
|
+
_action$payload3 = action.payload, channel = _action$payload3.channel, messageId = _action$payload3.messageId, networkChanged = _action$payload3.networkChanged, restoreWindow = _action$payload3.restoreWindow;
|
|
24141
23779
|
connectionState = store.getState().UserReducer.connectionStatus;
|
|
24142
23780
|
messages = store.getState().MessageReducer.activeChannelMessages;
|
|
24143
23781
|
if (!(channel !== null && channel !== void 0 && channel.id && !(channel !== null && channel !== void 0 && channel.isMockChannel))) {
|
|
@@ -24155,7 +23793,7 @@ function loadAroundMessageWorker(action) {
|
|
|
24155
23793
|
}
|
|
24156
23794
|
setActiveSegment(channel.id, restoreWindow.startId, restoreWindow.endId);
|
|
24157
23795
|
_context28.n = 1;
|
|
24158
|
-
return effects.call(loadOGMetadataForLinkMessages, cachedWindow.messages, true
|
|
23796
|
+
return effects.call(loadOGMetadataForLinkMessages, cachedWindow.messages, true);
|
|
24159
23797
|
case 1:
|
|
24160
23798
|
_context28.n = 2;
|
|
24161
23799
|
return effects.put(setMessagesHasPrevAC(cachedWindow.hasPrevMessages));
|
|
@@ -24173,7 +23811,7 @@ function loadAroundMessageWorker(action) {
|
|
|
24173
23811
|
return effects.put(addMessagesAC(_filteredPendingMessages, MESSAGE_LOAD_DIRECTION.NEXT));
|
|
24174
23812
|
case 5:
|
|
24175
23813
|
_context28.n = 6;
|
|
24176
|
-
return effects.call(loadOGMetadataForLinkMessages, _filteredPendingMessages, true
|
|
23814
|
+
return effects.call(loadOGMetadataForLinkMessages, _filteredPendingMessages, true);
|
|
24177
23815
|
case 6:
|
|
24178
23816
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
24179
23817
|
_context28.n = 7;
|
|
@@ -24209,7 +23847,7 @@ function loadAroundMessageWorker(action) {
|
|
|
24209
23847
|
return effects.put(setMessagesHasNextAC(cachedAroundWindow.hasNextMessages));
|
|
24210
23848
|
case 13:
|
|
24211
23849
|
_context28.n = 14;
|
|
24212
|
-
return effects.call(loadOGMetadataForLinkMessages, cachedAroundWindow.messages, true
|
|
23850
|
+
return effects.call(loadOGMetadataForLinkMessages, cachedAroundWindow.messages, true);
|
|
24213
23851
|
case 14:
|
|
24214
23852
|
_context28.n = 15;
|
|
24215
23853
|
return effects.put(setMessagesAC(JSON.parse(JSON.stringify(cachedAroundWindow.messages)), channel.id));
|
|
@@ -24221,7 +23859,7 @@ function loadAroundMessageWorker(action) {
|
|
|
24221
23859
|
return effects.put(addMessagesAC(_filteredPendingMessages2, MESSAGE_LOAD_DIRECTION.NEXT));
|
|
24222
23860
|
case 16:
|
|
24223
23861
|
_context28.n = 17;
|
|
24224
|
-
return effects.call(loadOGMetadataForLinkMessages, _filteredPendingMessages2, true
|
|
23862
|
+
return effects.call(loadOGMetadataForLinkMessages, _filteredPendingMessages2, true);
|
|
24225
23863
|
case 17:
|
|
24226
23864
|
_waitToSendPendingMessages = store.getState().UserReducer.waitToSendPendingMessages;
|
|
24227
23865
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED && _waitToSendPendingMessages)) {
|
|
@@ -24275,16 +23913,16 @@ function loadAroundMessageWorker(action) {
|
|
|
24275
23913
|
_context28.n = 24;
|
|
24276
23914
|
return effects.call(messageQuery.loadPreviousMessageId, loadPreviousMessageId);
|
|
24277
23915
|
case 24:
|
|
24278
|
-
|
|
23916
|
+
_t19 = _context28.v;
|
|
24279
23917
|
_context28.n = 26;
|
|
24280
23918
|
break;
|
|
24281
23919
|
case 25:
|
|
24282
|
-
|
|
23920
|
+
_t19 = {
|
|
24283
23921
|
messages: [],
|
|
24284
23922
|
hasNext: false
|
|
24285
23923
|
};
|
|
24286
23924
|
case 26:
|
|
24287
|
-
firstResult =
|
|
23925
|
+
firstResult = _t19;
|
|
24288
23926
|
if (!loadNextMessageId && firstResult.messages.length > 0) {
|
|
24289
23927
|
loadNextMessageId = getLastConfirmedMessageId(firstResult.messages);
|
|
24290
23928
|
} else if (!networkChanged && !loadNextMessageId && !firstResult.messages.length) {
|
|
@@ -24299,16 +23937,16 @@ function loadAroundMessageWorker(action) {
|
|
|
24299
23937
|
_context28.n = 27;
|
|
24300
23938
|
return effects.call(messageQuery.loadNextMessageId, loadNextMessageId);
|
|
24301
23939
|
case 27:
|
|
24302
|
-
|
|
23940
|
+
_t20 = _context28.v;
|
|
24303
23941
|
_context28.n = 29;
|
|
24304
23942
|
break;
|
|
24305
23943
|
case 28:
|
|
24306
|
-
|
|
23944
|
+
_t20 = {
|
|
24307
23945
|
messages: [],
|
|
24308
23946
|
hasNext: false
|
|
24309
23947
|
};
|
|
24310
23948
|
case 29:
|
|
24311
|
-
secondResult =
|
|
23949
|
+
secondResult = _t20;
|
|
24312
23950
|
resultMessages = networkChanged && !firstResult.messages.length && !secondResult.messages.length ? messages : [].concat(firstResult.messages, secondResult.messages);
|
|
24313
23951
|
result = {
|
|
24314
23952
|
messages: resultMessages,
|
|
@@ -24330,7 +23968,7 @@ function loadAroundMessageWorker(action) {
|
|
|
24330
23968
|
case 31:
|
|
24331
23969
|
appliedMessages = getCachedMessagesForResult(channel.id, result.messages);
|
|
24332
23970
|
_context28.n = 32;
|
|
24333
|
-
return effects.call(loadOGMetadataForLinkMessages, appliedMessages, true
|
|
23971
|
+
return effects.call(loadOGMetadataForLinkMessages, appliedMessages, true);
|
|
24334
23972
|
case 32:
|
|
24335
23973
|
_context28.n = 33;
|
|
24336
23974
|
return effects.put(setMessagesAC(JSON.parse(JSON.stringify(appliedMessages)), channel.id));
|
|
@@ -24343,7 +23981,7 @@ function loadAroundMessageWorker(action) {
|
|
|
24343
23981
|
return effects.put(addMessagesAC(filteredPendingMessages, MESSAGE_LOAD_DIRECTION.NEXT));
|
|
24344
23982
|
case 35:
|
|
24345
23983
|
_context28.n = 36;
|
|
24346
|
-
return effects.call(loadOGMetadataForLinkMessages, filteredPendingMessages, true
|
|
23984
|
+
return effects.call(loadOGMetadataForLinkMessages, filteredPendingMessages, true);
|
|
24347
23985
|
case 36:
|
|
24348
23986
|
waitToSendPendingMessages = store.getState().UserReducer.waitToSendPendingMessages;
|
|
24349
23987
|
if (!(connectionState === CONNECTION_STATUS.CONNECTED && waitToSendPendingMessages)) {
|
|
@@ -24360,8 +23998,8 @@ function loadAroundMessageWorker(action) {
|
|
|
24360
23998
|
break;
|
|
24361
23999
|
case 39:
|
|
24362
24000
|
_context28.p = 39;
|
|
24363
|
-
|
|
24364
|
-
log.error('error in loadAroundMessage',
|
|
24001
|
+
_t21 = _context28.v;
|
|
24002
|
+
log.error('error in loadAroundMessage', _t21);
|
|
24365
24003
|
case 40:
|
|
24366
24004
|
_context28.p = 40;
|
|
24367
24005
|
_context28.n = 41;
|
|
@@ -24374,12 +24012,12 @@ function loadAroundMessageWorker(action) {
|
|
|
24374
24012
|
}, _marked22$1, null, [[0, 39, 40, 42]]);
|
|
24375
24013
|
}
|
|
24376
24014
|
function backgroundCacheAroundMessage(action) {
|
|
24377
|
-
var _action$
|
|
24015
|
+
var _action$payload4, channel, messageId, waited, SceytChatClient, messageQueryBuilder, messageQuery, firstResult, loadNextMessageId, secondResult, resultMessages, firstConfirmedMessageId, lastConfirmedMessageId, _t22;
|
|
24378
24016
|
return _regenerator().w(function (_context29) {
|
|
24379
24017
|
while (1) switch (_context29.p = _context29.n) {
|
|
24380
24018
|
case 0:
|
|
24381
24019
|
_context29.p = 0;
|
|
24382
|
-
_action$
|
|
24020
|
+
_action$payload4 = action.payload, channel = _action$payload4.channel, messageId = _action$payload4.messageId;
|
|
24383
24021
|
if (!(!(channel !== null && channel !== void 0 && channel.id) || !messageId)) {
|
|
24384
24022
|
_context29.n = 1;
|
|
24385
24023
|
break;
|
|
@@ -24436,8 +24074,8 @@ function backgroundCacheAroundMessage(action) {
|
|
|
24436
24074
|
break;
|
|
24437
24075
|
case 9:
|
|
24438
24076
|
_context29.p = 9;
|
|
24439
|
-
|
|
24440
|
-
log.error('error in backgroundCacheAroundMessage',
|
|
24077
|
+
_t22 = _context29.v;
|
|
24078
|
+
log.error('error in backgroundCacheAroundMessage', _t22);
|
|
24441
24079
|
case 10:
|
|
24442
24080
|
return _context29.a(2);
|
|
24443
24081
|
}
|
|
@@ -24467,7 +24105,7 @@ function loadAroundMessage(action) {
|
|
|
24467
24105
|
}, _marked24$1);
|
|
24468
24106
|
}
|
|
24469
24107
|
function loadNearUnread(action) {
|
|
24470
|
-
var channel, connectionState, _channel$lastMessage5, _channel$lastMessage6, _channel$lastMessage7, cachedNearWindow, cacheWasShown, cachedLastConfirmedMessageId, cachedHasPrevMessages, cachedHasNextMessages, filteredPendingMessages, SceytChatClient, messageQueryBuilder, messageQuery, result, firstConfirmedMessageId, lastConfirmedMessageId, refreshedCachedNearWindow, lastAppliedWindow, appliedMessages, hasPrevMessages, refreshedLastConfirmedMessageId, hasNextMessages, changedMessages, _filteredPendingMessages3, waitToSendPendingMessages,
|
|
24108
|
+
var channel, connectionState, _channel$lastMessage5, _channel$lastMessage6, _channel$lastMessage7, cachedNearWindow, cacheWasShown, cachedLastConfirmedMessageId, cachedHasPrevMessages, cachedHasNextMessages, filteredPendingMessages, SceytChatClient, messageQueryBuilder, messageQuery, result, firstConfirmedMessageId, lastConfirmedMessageId, refreshedCachedNearWindow, lastAppliedWindow, appliedMessages, hasPrevMessages, refreshedLastConfirmedMessageId, hasNextMessages, changedMessages, _filteredPendingMessages3, waitToSendPendingMessages, _t23;
|
|
24471
24109
|
return _regenerator().w(function (_context31) {
|
|
24472
24110
|
while (1) switch (_context31.p = _context31.n) {
|
|
24473
24111
|
case 0:
|
|
@@ -24497,7 +24135,7 @@ function loadNearUnread(action) {
|
|
|
24497
24135
|
return effects.put(setMessagesHasNextAC(cachedHasNextMessages));
|
|
24498
24136
|
case 3:
|
|
24499
24137
|
_context31.n = 4;
|
|
24500
|
-
return effects.call(loadOGMetadataForLinkMessages, cachedNearWindow.messages, true
|
|
24138
|
+
return effects.call(loadOGMetadataForLinkMessages, cachedNearWindow.messages, true);
|
|
24501
24139
|
case 4:
|
|
24502
24140
|
_context31.n = 5;
|
|
24503
24141
|
return effects.put(setMessagesAC(cachedNearWindow.messages, channel.id));
|
|
@@ -24515,7 +24153,7 @@ function loadNearUnread(action) {
|
|
|
24515
24153
|
return effects.put(addMessagesAC(filteredPendingMessages, MESSAGE_LOAD_DIRECTION.NEXT));
|
|
24516
24154
|
case 8:
|
|
24517
24155
|
_context31.n = 9;
|
|
24518
|
-
return effects.call(loadOGMetadataForLinkMessages, filteredPendingMessages, true
|
|
24156
|
+
return effects.call(loadOGMetadataForLinkMessages, filteredPendingMessages, true);
|
|
24519
24157
|
case 9:
|
|
24520
24158
|
_context31.n = 11;
|
|
24521
24159
|
break;
|
|
@@ -24579,7 +24217,7 @@ function loadNearUnread(action) {
|
|
|
24579
24217
|
return effects.put(setUnreadMessageIdAC(channel.lastDisplayedMessageId));
|
|
24580
24218
|
case 20:
|
|
24581
24219
|
_context31.n = 21;
|
|
24582
|
-
return effects.call(loadOGMetadataForLinkMessages, appliedMessages, true
|
|
24220
|
+
return effects.call(loadOGMetadataForLinkMessages, appliedMessages, true);
|
|
24583
24221
|
case 21:
|
|
24584
24222
|
if (!(cacheWasShown && sameConfirmedWindow(lastAppliedWindow, appliedMessages))) {
|
|
24585
24223
|
_context31.n = 23;
|
|
@@ -24612,7 +24250,7 @@ function loadNearUnread(action) {
|
|
|
24612
24250
|
return effects.put(addMessagesAC(_filteredPendingMessages3, MESSAGE_LOAD_DIRECTION.NEXT));
|
|
24613
24251
|
case 27:
|
|
24614
24252
|
_context31.n = 28;
|
|
24615
|
-
return effects.call(loadOGMetadataForLinkMessages, _filteredPendingMessages3, true
|
|
24253
|
+
return effects.call(loadOGMetadataForLinkMessages, _filteredPendingMessages3, true);
|
|
24616
24254
|
case 28:
|
|
24617
24255
|
waitToSendPendingMessages = store.getState().UserReducer.waitToSendPendingMessages;
|
|
24618
24256
|
if (!waitToSendPendingMessages) {
|
|
@@ -24629,8 +24267,8 @@ function loadNearUnread(action) {
|
|
|
24629
24267
|
break;
|
|
24630
24268
|
case 31:
|
|
24631
24269
|
_context31.p = 31;
|
|
24632
|
-
|
|
24633
|
-
log.error('error in loadNearUnread',
|
|
24270
|
+
_t23 = _context31.v;
|
|
24271
|
+
log.error('error in loadNearUnread', _t23);
|
|
24634
24272
|
case 32:
|
|
24635
24273
|
_context31.p = 32;
|
|
24636
24274
|
_context31.n = 33;
|
|
@@ -24643,7 +24281,7 @@ function loadNearUnread(action) {
|
|
|
24643
24281
|
}, _marked25$1, null, [[0, 31, 32, 34]]);
|
|
24644
24282
|
}
|
|
24645
24283
|
function loadDefaultMessages(action) {
|
|
24646
|
-
var channel, connectionState, _channel$lastMessage8, _channel$lastMessage9, _channel$lastMessage0, _result$messages, SceytChatClient, messageQueryBuilder, messageQuery, cachedMessages, messages, _filteredPendingMessages4, result, updatedMessages, appliedMessages, messageIdForLoad, firstConfirmedMessageId, lastConfirmedMessageId, shouldPatchShownCache, changedMessages, _iterator3, _step3, message, filteredPendingMessages, waitToSendPendingMessages, _t25, _t26, _t27
|
|
24284
|
+
var channel, connectionState, _channel$lastMessage8, _channel$lastMessage9, _channel$lastMessage0, _result$messages, SceytChatClient, messageQueryBuilder, messageQuery, cachedMessages, messages, _filteredPendingMessages4, result, updatedMessages, appliedMessages, messageIdForLoad, firstConfirmedMessageId, lastConfirmedMessageId, shouldPatchShownCache, changedMessages, _iterator3, _step3, message, filteredPendingMessages, waitToSendPendingMessages, _t24, _t25, _t26, _t27;
|
|
24647
24285
|
return _regenerator().w(function (_context32) {
|
|
24648
24286
|
while (1) switch (_context32.p = _context32.n) {
|
|
24649
24287
|
case 0:
|
|
@@ -24665,13 +24303,13 @@ function loadDefaultMessages(action) {
|
|
|
24665
24303
|
_context32.n = 1;
|
|
24666
24304
|
return effects.call(messageQueryBuilder.build);
|
|
24667
24305
|
case 1:
|
|
24668
|
-
|
|
24306
|
+
_t24 = _context32.v;
|
|
24669
24307
|
_context32.n = 3;
|
|
24670
24308
|
break;
|
|
24671
24309
|
case 2:
|
|
24672
|
-
|
|
24310
|
+
_t24 = null;
|
|
24673
24311
|
case 3:
|
|
24674
|
-
messageQuery =
|
|
24312
|
+
messageQuery = _t24;
|
|
24675
24313
|
query.messageQuery = messageQuery;
|
|
24676
24314
|
cachedMessages = getLatestMessagesFromMap(channel.id, MESSAGES_MAX_PAGE_COUNT);
|
|
24677
24315
|
if (!(cachedMessages && cachedMessages.length)) {
|
|
@@ -24680,7 +24318,7 @@ function loadDefaultMessages(action) {
|
|
|
24680
24318
|
}
|
|
24681
24319
|
messages = cachedMessages;
|
|
24682
24320
|
_context32.n = 4;
|
|
24683
|
-
return effects.call(loadOGMetadataForLinkMessages, messages, true
|
|
24321
|
+
return effects.call(loadOGMetadataForLinkMessages, messages, true);
|
|
24684
24322
|
case 4:
|
|
24685
24323
|
_context32.n = 5;
|
|
24686
24324
|
return effects.put(setMessagesAC(messages, channel.id));
|
|
@@ -24692,7 +24330,7 @@ function loadDefaultMessages(action) {
|
|
|
24692
24330
|
return effects.put(addMessagesAC(_filteredPendingMessages4, MESSAGE_LOAD_DIRECTION.NEXT));
|
|
24693
24331
|
case 6:
|
|
24694
24332
|
_context32.n = 7;
|
|
24695
|
-
return effects.call(loadOGMetadataForLinkMessages, _filteredPendingMessages4, true
|
|
24333
|
+
return effects.call(loadOGMetadataForLinkMessages, _filteredPendingMessages4, true);
|
|
24696
24334
|
case 7:
|
|
24697
24335
|
_context32.n = 9;
|
|
24698
24336
|
break;
|
|
@@ -24715,16 +24353,16 @@ function loadDefaultMessages(action) {
|
|
|
24715
24353
|
_context32.n = 10;
|
|
24716
24354
|
return effects.call(messageQuery.loadPreviousMessageId, channel === null || channel === void 0 ? void 0 : channel.lastDisplayedMessageId);
|
|
24717
24355
|
case 10:
|
|
24718
|
-
|
|
24356
|
+
_t25 = _context32.v;
|
|
24719
24357
|
_context32.n = 12;
|
|
24720
24358
|
break;
|
|
24721
24359
|
case 11:
|
|
24722
|
-
|
|
24360
|
+
_t25 = {
|
|
24723
24361
|
messages: [],
|
|
24724
24362
|
hasNext: false
|
|
24725
24363
|
};
|
|
24726
24364
|
case 12:
|
|
24727
|
-
result =
|
|
24365
|
+
result = _t25;
|
|
24728
24366
|
_context32.n = 17;
|
|
24729
24367
|
break;
|
|
24730
24368
|
case 13:
|
|
@@ -24735,16 +24373,16 @@ function loadDefaultMessages(action) {
|
|
|
24735
24373
|
_context32.n = 14;
|
|
24736
24374
|
return effects.call(messageQuery.loadPrevious);
|
|
24737
24375
|
case 14:
|
|
24738
|
-
|
|
24376
|
+
_t26 = _context32.v;
|
|
24739
24377
|
_context32.n = 16;
|
|
24740
24378
|
break;
|
|
24741
24379
|
case 15:
|
|
24742
|
-
|
|
24380
|
+
_t26 = {
|
|
24743
24381
|
messages: [],
|
|
24744
24382
|
hasNext: false
|
|
24745
24383
|
};
|
|
24746
24384
|
case 16:
|
|
24747
|
-
result =
|
|
24385
|
+
result = _t26;
|
|
24748
24386
|
case 17:
|
|
24749
24387
|
updatedMessages = [];
|
|
24750
24388
|
result.messages.forEach(function (msg) {
|
|
@@ -24773,7 +24411,7 @@ function loadDefaultMessages(action) {
|
|
|
24773
24411
|
case 18:
|
|
24774
24412
|
appliedMessages = getCachedMessagesForResult(channel.id, updatedMessages);
|
|
24775
24413
|
_context32.n = 19;
|
|
24776
|
-
return effects.call(loadOGMetadataForLinkMessages, appliedMessages, true
|
|
24414
|
+
return effects.call(loadOGMetadataForLinkMessages, appliedMessages, true);
|
|
24777
24415
|
case 19:
|
|
24778
24416
|
_context32.n = 20;
|
|
24779
24417
|
return effects.put(setMessagesHasPrevAC(true));
|
|
@@ -24823,7 +24461,7 @@ function loadDefaultMessages(action) {
|
|
|
24823
24461
|
return effects.put(addMessagesAC(filteredPendingMessages, MESSAGE_LOAD_DIRECTION.NEXT));
|
|
24824
24462
|
case 29:
|
|
24825
24463
|
_context32.n = 30;
|
|
24826
|
-
return effects.call(loadOGMetadataForLinkMessages, filteredPendingMessages, true
|
|
24464
|
+
return effects.call(loadOGMetadataForLinkMessages, filteredPendingMessages, true);
|
|
24827
24465
|
case 30:
|
|
24828
24466
|
if (!(cachedMessages !== null && cachedMessages !== void 0 && cachedMessages.length && connectionState === CONNECTION_STATUS.CONNECTED)) {
|
|
24829
24467
|
_context32.n = 31;
|
|
@@ -24847,8 +24485,8 @@ function loadDefaultMessages(action) {
|
|
|
24847
24485
|
break;
|
|
24848
24486
|
case 34:
|
|
24849
24487
|
_context32.p = 34;
|
|
24850
|
-
|
|
24851
|
-
log.error('error in loadDefaultMessages',
|
|
24488
|
+
_t27 = _context32.v;
|
|
24489
|
+
log.error('error in loadDefaultMessages', _t27);
|
|
24852
24490
|
case 35:
|
|
24853
24491
|
_context32.p = 35;
|
|
24854
24492
|
_context32.n = 36;
|
|
@@ -24861,7 +24499,7 @@ function loadDefaultMessages(action) {
|
|
|
24861
24499
|
}, _marked26$1, null, [[0, 34, 35, 37]]);
|
|
24862
24500
|
}
|
|
24863
24501
|
function getMessagesQuery(action) {
|
|
24864
|
-
var _action$
|
|
24502
|
+
var _action$payload5, channel, limit, networkChanged, _action$payload5$appl, applyVisibleWindow, channelNewMessageCount, connectionState, SceytChatClient, messageQueryBuilder, messageQuery, result, appliedMessages, firstConfirmedMessageId, lastConfirmedMessageId, _channel$lastMessage1, cachedMessages, cacheIsCurrent, _firstConfirmedMessageId2, _lastConfirmedMessageId2, activeMessages, activeConfirmedMessages, sameVisibleWindow, filteredPendingMessages, activeById, changedMessages, waitToSendPendingMessages, _t28, _t29, _t30, _t31;
|
|
24865
24503
|
return _regenerator().w(function (_context33) {
|
|
24866
24504
|
while (1) switch (_context33.p = _context33.n) {
|
|
24867
24505
|
case 0:
|
|
@@ -24869,7 +24507,7 @@ function getMessagesQuery(action) {
|
|
|
24869
24507
|
_context33.n = 1;
|
|
24870
24508
|
return effects.call(setMessageListLoading, 'both', LOADING_STATE.LOADING);
|
|
24871
24509
|
case 1:
|
|
24872
|
-
_action$
|
|
24510
|
+
_action$payload5 = action.payload, channel = _action$payload5.channel, limit = _action$payload5.limit, networkChanged = _action$payload5.networkChanged, _action$payload5$appl = _action$payload5.applyVisibleWindow, applyVisibleWindow = _action$payload5$appl === void 0 ? true : _action$payload5$appl;
|
|
24873
24511
|
channelNewMessageCount = (channel === null || channel === void 0 ? void 0 : channel.newMessageCount) || 0;
|
|
24874
24512
|
connectionState = store.getState().UserReducer.connectionStatus;
|
|
24875
24513
|
if (!(channel !== null && channel !== void 0 && channel.id && !(channel !== null && channel !== void 0 && channel.isMockChannel))) {
|
|
@@ -24898,13 +24536,13 @@ function getMessagesQuery(action) {
|
|
|
24898
24536
|
_context33.n = 3;
|
|
24899
24537
|
return effects.call(messageQueryBuilder.build);
|
|
24900
24538
|
case 3:
|
|
24901
|
-
|
|
24539
|
+
_t28 = _context33.v;
|
|
24902
24540
|
_context33.n = 5;
|
|
24903
24541
|
break;
|
|
24904
24542
|
case 4:
|
|
24905
|
-
|
|
24543
|
+
_t28 = null;
|
|
24906
24544
|
case 5:
|
|
24907
|
-
messageQuery =
|
|
24545
|
+
messageQuery = _t28;
|
|
24908
24546
|
query.messageQuery = messageQuery;
|
|
24909
24547
|
result = {
|
|
24910
24548
|
messages: [],
|
|
@@ -24927,16 +24565,16 @@ function getMessagesQuery(action) {
|
|
|
24927
24565
|
_context33.n = 6;
|
|
24928
24566
|
return effects.call(messageQuery.loadNearMessageId, channel.lastDisplayedMessageId);
|
|
24929
24567
|
case 6:
|
|
24930
|
-
|
|
24568
|
+
_t29 = _context33.v;
|
|
24931
24569
|
_context33.n = 8;
|
|
24932
24570
|
break;
|
|
24933
24571
|
case 7:
|
|
24934
|
-
|
|
24572
|
+
_t29 = {
|
|
24935
24573
|
messages: [],
|
|
24936
24574
|
hasNext: false
|
|
24937
24575
|
};
|
|
24938
24576
|
case 8:
|
|
24939
|
-
result =
|
|
24577
|
+
result = _t29;
|
|
24940
24578
|
_context33.n = 13;
|
|
24941
24579
|
break;
|
|
24942
24580
|
case 9:
|
|
@@ -24947,19 +24585,19 @@ function getMessagesQuery(action) {
|
|
|
24947
24585
|
_context33.n = 10;
|
|
24948
24586
|
return effects.call(messageQuery.loadPrevious);
|
|
24949
24587
|
case 10:
|
|
24950
|
-
|
|
24588
|
+
_t30 = _context33.v;
|
|
24951
24589
|
_context33.n = 12;
|
|
24952
24590
|
break;
|
|
24953
24591
|
case 11:
|
|
24954
|
-
|
|
24592
|
+
_t30 = {
|
|
24955
24593
|
messages: [],
|
|
24956
24594
|
hasNext: false
|
|
24957
24595
|
};
|
|
24958
24596
|
case 12:
|
|
24959
|
-
result =
|
|
24597
|
+
result = _t30;
|
|
24960
24598
|
case 13:
|
|
24961
24599
|
_context33.n = 14;
|
|
24962
|
-
return effects.call(loadOGMetadataForLinkMessages, result.messages, true
|
|
24600
|
+
return effects.call(loadOGMetadataForLinkMessages, result.messages, true);
|
|
24963
24601
|
case 14:
|
|
24964
24602
|
_context33.n = 15;
|
|
24965
24603
|
return effects.put(setMessagesAC(JSON.parse(JSON.stringify(result.messages)), channel.id));
|
|
@@ -25017,7 +24655,7 @@ function getMessagesQuery(action) {
|
|
|
25017
24655
|
appliedMessages = result.messages;
|
|
25018
24656
|
}
|
|
25019
24657
|
_context33.n = 23;
|
|
25020
|
-
return effects.call(loadOGMetadataForLinkMessages, appliedMessages, true
|
|
24658
|
+
return effects.call(loadOGMetadataForLinkMessages, appliedMessages, true);
|
|
25021
24659
|
case 23:
|
|
25022
24660
|
activeMessages = store.getState().MessageReducer.activeChannelMessages || [];
|
|
25023
24661
|
activeConfirmedMessages = activeMessages.filter(function (message) {
|
|
@@ -25041,7 +24679,7 @@ function getMessagesQuery(action) {
|
|
|
25041
24679
|
return effects.put(addMessagesAC(filteredPendingMessages, MESSAGE_LOAD_DIRECTION.NEXT));
|
|
25042
24680
|
case 26:
|
|
25043
24681
|
_context33.n = 27;
|
|
25044
|
-
return effects.call(loadOGMetadataForLinkMessages, filteredPendingMessages, true
|
|
24682
|
+
return effects.call(loadOGMetadataForLinkMessages, filteredPendingMessages, true);
|
|
25045
24683
|
case 27:
|
|
25046
24684
|
_context33.n = 30;
|
|
25047
24685
|
break;
|
|
@@ -25098,8 +24736,8 @@ function getMessagesQuery(action) {
|
|
|
25098
24736
|
break;
|
|
25099
24737
|
case 35:
|
|
25100
24738
|
_context33.p = 35;
|
|
25101
|
-
|
|
25102
|
-
log.error('error in message query',
|
|
24739
|
+
_t31 = _context33.v;
|
|
24740
|
+
log.error('error in message query', _t31);
|
|
25103
24741
|
case 36:
|
|
25104
24742
|
_context33.p = 36;
|
|
25105
24743
|
_context33.n = 37;
|
|
@@ -25112,7 +24750,7 @@ function getMessagesQuery(action) {
|
|
|
25112
24750
|
}, _marked27$1, null, [[0, 35, 36, 38]]);
|
|
25113
24751
|
}
|
|
25114
24752
|
function getMessageQuery(action) {
|
|
25115
|
-
var payload, channelId, messageId, channel, connectionState, messages, fetchedMessage,
|
|
24753
|
+
var payload, channelId, messageId, channel, connectionState, messages, fetchedMessage, _t32;
|
|
25116
24754
|
return _regenerator().w(function (_context34) {
|
|
25117
24755
|
while (1) switch (_context34.p = _context34.n) {
|
|
25118
24756
|
case 0:
|
|
@@ -25158,15 +24796,15 @@ function getMessageQuery(action) {
|
|
|
25158
24796
|
break;
|
|
25159
24797
|
case 6:
|
|
25160
24798
|
_context34.p = 6;
|
|
25161
|
-
|
|
25162
|
-
log.error('error in message query',
|
|
24799
|
+
_t32 = _context34.v;
|
|
24800
|
+
log.error('error in message query', _t32);
|
|
25163
24801
|
case 7:
|
|
25164
24802
|
return _context34.a(2);
|
|
25165
24803
|
}
|
|
25166
24804
|
}, _marked28$1, null, [[0, 6]]);
|
|
25167
24805
|
}
|
|
25168
24806
|
function prefetchMessages(channelId, fromMessageId, direction, pages) {
|
|
25169
|
-
var key, cancelVersion, SceytChatClient, request, currentFromId, i, cached, mqb, mq, result, _cached, _mqb, _mq, _result,
|
|
24807
|
+
var key, cancelVersion, SceytChatClient, request, currentFromId, i, cached, mqb, mq, result, _cached, _mqb, _mq, _result, _t33;
|
|
25170
24808
|
return _regenerator().w(function (_context35) {
|
|
25171
24809
|
while (1) switch (_context35.p = _context35.n) {
|
|
25172
24810
|
case 0:
|
|
@@ -25334,8 +24972,8 @@ function prefetchMessages(channelId, fromMessageId, direction, pages) {
|
|
|
25334
24972
|
break;
|
|
25335
24973
|
case 24:
|
|
25336
24974
|
_context35.p = 24;
|
|
25337
|
-
|
|
25338
|
-
log.error('[PREFETCH] prefetchMessages error:',
|
|
24975
|
+
_t33 = _context35.v;
|
|
24976
|
+
log.error('[PREFETCH] prefetchMessages error:', _t33);
|
|
25339
24977
|
case 25:
|
|
25340
24978
|
_context35.p = 25;
|
|
25341
24979
|
queuedPrefetchRequests["delete"](key);
|
|
@@ -25348,11 +24986,11 @@ function prefetchMessages(channelId, fromMessageId, direction, pages) {
|
|
|
25348
24986
|
}, _marked29$1, null, [[2, 24, 25, 26]]);
|
|
25349
24987
|
}
|
|
25350
24988
|
function prefetchMessagesFromAction(action) {
|
|
25351
|
-
var _action$
|
|
24989
|
+
var _action$payload6, channelId, fromMessageId, direction, pages;
|
|
25352
24990
|
return _regenerator().w(function (_context36) {
|
|
25353
24991
|
while (1) switch (_context36.n) {
|
|
25354
24992
|
case 0:
|
|
25355
|
-
_action$
|
|
24993
|
+
_action$payload6 = action.payload, channelId = _action$payload6.channelId, fromMessageId = _action$payload6.fromMessageId, direction = _action$payload6.direction, pages = _action$payload6.pages;
|
|
25356
24994
|
if (!(!channelId || !fromMessageId || !direction || !pages)) {
|
|
25357
24995
|
_context36.n = 1;
|
|
25358
24996
|
break;
|
|
@@ -25367,7 +25005,7 @@ function prefetchMessagesFromAction(action) {
|
|
|
25367
25005
|
}, _marked30$1);
|
|
25368
25006
|
}
|
|
25369
25007
|
function loadMoreMessages(action) {
|
|
25370
|
-
var acquiredLock, loadingScope, payload, limit, direction, channelId, messageId, hasNext, requestId, inFlightKey, SceytChatClient, messageQueryBuilder, messageQuery, connectionState, result, reachedLatestConfirmedEdge, nextHasPrevState, nextHasNextState, currentConfirmedMessages, prefetchKey, mapCached, aheadCached, pagesToFetch, fromId, _result$messages$, _result$messages2, nextWindowConfirmedCount, _mapCached, lastConfirmedMsg, lastConfirmedId, _aheadCached, confirmedAheadCount, hasCachedNext, canLoadServerNext, _pagesToFetch, _reverse$find, lastAheadConfirmedId, _fromId, _result$messages$2, _result$messages3, shouldApplyVisibleResult, filteredPendingMessages,
|
|
25008
|
+
var acquiredLock, loadingScope, payload, limit, direction, channelId, messageId, hasNext, requestId, inFlightKey, SceytChatClient, messageQueryBuilder, messageQuery, connectionState, result, reachedLatestConfirmedEdge, nextHasPrevState, nextHasNextState, currentConfirmedMessages, prefetchKey, mapCached, aheadCached, pagesToFetch, fromId, _result$messages$, _result$messages2, nextWindowConfirmedCount, _mapCached, lastConfirmedMsg, lastConfirmedId, _aheadCached, confirmedAheadCount, hasCachedNext, canLoadServerNext, _pagesToFetch, _reverse$find, lastAheadConfirmedId, _fromId, _result$messages$2, _result$messages3, shouldApplyVisibleResult, filteredPendingMessages, _t34;
|
|
25371
25009
|
return _regenerator().w(function (_context37) {
|
|
25372
25010
|
while (1) switch (_context37.p = _context37.n) {
|
|
25373
25011
|
case 0:
|
|
@@ -25618,7 +25256,7 @@ function loadMoreMessages(action) {
|
|
|
25618
25256
|
break;
|
|
25619
25257
|
}
|
|
25620
25258
|
_context37.n = 32;
|
|
25621
|
-
return effects.call(loadOGMetadataForLinkMessages, result.messages, true
|
|
25259
|
+
return effects.call(loadOGMetadataForLinkMessages, result.messages, true);
|
|
25622
25260
|
case 32:
|
|
25623
25261
|
_context37.n = 33;
|
|
25624
25262
|
return effects.put(addMessagesAC(JSON.parse(JSON.stringify(result.messages)), direction));
|
|
@@ -25648,14 +25286,14 @@ function loadMoreMessages(action) {
|
|
|
25648
25286
|
return effects.put(addMessagesAC(filteredPendingMessages, MESSAGE_LOAD_DIRECTION.NEXT));
|
|
25649
25287
|
case 36:
|
|
25650
25288
|
_context37.n = 37;
|
|
25651
|
-
return effects.call(loadOGMetadataForLinkMessages, filteredPendingMessages, true
|
|
25289
|
+
return effects.call(loadOGMetadataForLinkMessages, filteredPendingMessages, true);
|
|
25652
25290
|
case 37:
|
|
25653
25291
|
_context37.n = 39;
|
|
25654
25292
|
break;
|
|
25655
25293
|
case 38:
|
|
25656
25294
|
_context37.p = 38;
|
|
25657
|
-
|
|
25658
|
-
log.error('[MESSAGE_LIST] loadMoreMessages ERROR:',
|
|
25295
|
+
_t34 = _context37.v;
|
|
25296
|
+
log.error('[MESSAGE_LIST] loadMoreMessages ERROR:', _t34 === null || _t34 === void 0 ? void 0 : _t34.type);
|
|
25659
25297
|
case 39:
|
|
25660
25298
|
_context37.p = 39;
|
|
25661
25299
|
if (acquiredLock) {
|
|
@@ -25675,7 +25313,7 @@ function loadMoreMessages(action) {
|
|
|
25675
25313
|
}, _marked31$1, null, [[1, 38, 39, 40]]);
|
|
25676
25314
|
}
|
|
25677
25315
|
function addReaction(action) {
|
|
25678
|
-
var payload, channelId, messageId, key, score, reason, enforceUnique, user, channel, _yield$call, message, reaction, channelUpdateParam,
|
|
25316
|
+
var payload, channelId, messageId, key, score, reason, enforceUnique, user, channel, _yield$call, message, reaction, channelUpdateParam, _t35;
|
|
25679
25317
|
return _regenerator().w(function (_context38) {
|
|
25680
25318
|
while (1) switch (_context38.p = _context38.n) {
|
|
25681
25319
|
case 0:
|
|
@@ -25732,15 +25370,15 @@ function addReaction(action) {
|
|
|
25732
25370
|
break;
|
|
25733
25371
|
case 8:
|
|
25734
25372
|
_context38.p = 8;
|
|
25735
|
-
|
|
25736
|
-
log.error('ERROR in add reaction',
|
|
25373
|
+
_t35 = _context38.v;
|
|
25374
|
+
log.error('ERROR in add reaction', _t35.message);
|
|
25737
25375
|
case 9:
|
|
25738
25376
|
return _context38.a(2);
|
|
25739
25377
|
}
|
|
25740
25378
|
}, _marked32$1, null, [[0, 8]]);
|
|
25741
25379
|
}
|
|
25742
25380
|
function deleteReaction(action) {
|
|
25743
|
-
var payload, channelId, messageId, key, isLastReaction, channel, _yield$call2, message, reaction, channelUpdateParam,
|
|
25381
|
+
var payload, channelId, messageId, key, isLastReaction, channel, _yield$call2, message, reaction, channelUpdateParam, _t36;
|
|
25744
25382
|
return _regenerator().w(function (_context39) {
|
|
25745
25383
|
while (1) switch (_context39.p = _context39.n) {
|
|
25746
25384
|
case 0:
|
|
@@ -25787,15 +25425,15 @@ function deleteReaction(action) {
|
|
|
25787
25425
|
break;
|
|
25788
25426
|
case 7:
|
|
25789
25427
|
_context39.p = 7;
|
|
25790
|
-
|
|
25791
|
-
log.error('ERROR in delete reaction',
|
|
25428
|
+
_t36 = _context39.v;
|
|
25429
|
+
log.error('ERROR in delete reaction', _t36.message);
|
|
25792
25430
|
case 8:
|
|
25793
25431
|
return _context39.a(2);
|
|
25794
25432
|
}
|
|
25795
25433
|
}, _marked33$1, null, [[0, 7]]);
|
|
25796
25434
|
}
|
|
25797
25435
|
function getReactions(action) {
|
|
25798
|
-
var payload, messageId, key, limit, SceytChatClient, reactionQueryBuilder, reactionQuery, result,
|
|
25436
|
+
var payload, messageId, key, limit, SceytChatClient, reactionQueryBuilder, reactionQuery, result, _t37;
|
|
25799
25437
|
return _regenerator().w(function (_context40) {
|
|
25800
25438
|
while (1) switch (_context40.p = _context40.n) {
|
|
25801
25439
|
case 0:
|
|
@@ -25830,15 +25468,15 @@ function getReactions(action) {
|
|
|
25830
25468
|
break;
|
|
25831
25469
|
case 6:
|
|
25832
25470
|
_context40.p = 6;
|
|
25833
|
-
|
|
25834
|
-
log.error('ERROR in get reactions',
|
|
25471
|
+
_t37 = _context40.v;
|
|
25472
|
+
log.error('ERROR in get reactions', _t37.message);
|
|
25835
25473
|
case 7:
|
|
25836
25474
|
return _context40.a(2);
|
|
25837
25475
|
}
|
|
25838
25476
|
}, _marked34$1, null, [[0, 6]]);
|
|
25839
25477
|
}
|
|
25840
25478
|
function loadMoreReactions(action) {
|
|
25841
|
-
var payload, limit, ReactionQuery, result,
|
|
25479
|
+
var payload, limit, ReactionQuery, result, _t38;
|
|
25842
25480
|
return _regenerator().w(function (_context41) {
|
|
25843
25481
|
while (1) switch (_context41.p = _context41.n) {
|
|
25844
25482
|
case 0:
|
|
@@ -25866,19 +25504,19 @@ function loadMoreReactions(action) {
|
|
|
25866
25504
|
break;
|
|
25867
25505
|
case 5:
|
|
25868
25506
|
_context41.p = 5;
|
|
25869
|
-
|
|
25870
|
-
log.error('ERROR in load more reactions',
|
|
25507
|
+
_t38 = _context41.v;
|
|
25508
|
+
log.error('ERROR in load more reactions', _t38.message);
|
|
25871
25509
|
case 6:
|
|
25872
25510
|
return _context41.a(2);
|
|
25873
25511
|
}
|
|
25874
25512
|
}, _marked35$1, null, [[0, 5]]);
|
|
25875
25513
|
}
|
|
25876
25514
|
function getMessageAttachments(action) {
|
|
25877
|
-
var _action$
|
|
25515
|
+
var _action$payload7, channelId, attachmentType, limit, direction, attachmentId, forPopup, SceytChatClient, typeList, AttachmentByTypeQueryBuilder, AttachmentByTypeQuery, result, attachments, attachmentIndex, hasPrev, hasNext, _t39;
|
|
25878
25516
|
return _regenerator().w(function (_context42) {
|
|
25879
25517
|
while (1) switch (_context42.p = _context42.n) {
|
|
25880
25518
|
case 0:
|
|
25881
|
-
_action$
|
|
25519
|
+
_action$payload7 = action.payload, channelId = _action$payload7.channelId, attachmentType = _action$payload7.attachmentType, limit = _action$payload7.limit, direction = _action$payload7.direction, attachmentId = _action$payload7.attachmentId, forPopup = _action$payload7.forPopup;
|
|
25882
25520
|
_context42.p = 1;
|
|
25883
25521
|
_context42.n = 2;
|
|
25884
25522
|
return effects.put(setAttachmentsLoadingStateAC(LOADING_STATE.LOADING, forPopup));
|
|
@@ -25973,8 +25611,8 @@ function getMessageAttachments(action) {
|
|
|
25973
25611
|
break;
|
|
25974
25612
|
case 15:
|
|
25975
25613
|
_context42.p = 15;
|
|
25976
|
-
|
|
25977
|
-
log.error('error in message attachment query',
|
|
25614
|
+
_t39 = _context42.v;
|
|
25615
|
+
log.error('error in message attachment query', _t39);
|
|
25978
25616
|
case 16:
|
|
25979
25617
|
_context42.p = 16;
|
|
25980
25618
|
_context42.n = 17;
|
|
@@ -25987,11 +25625,11 @@ function getMessageAttachments(action) {
|
|
|
25987
25625
|
}, _marked36$1, null, [[1, 15, 16, 18]]);
|
|
25988
25626
|
}
|
|
25989
25627
|
function loadMoreMessageAttachments(action) {
|
|
25990
|
-
var _action$
|
|
25628
|
+
var _action$payload8, limit, direction, forPopup, attachmentId, AttachmentQuery, result, _result2, attachments, hasNext, _t40;
|
|
25991
25629
|
return _regenerator().w(function (_context43) {
|
|
25992
25630
|
while (1) switch (_context43.p = _context43.n) {
|
|
25993
25631
|
case 0:
|
|
25994
|
-
_action$
|
|
25632
|
+
_action$payload8 = action.payload, limit = _action$payload8.limit, direction = _action$payload8.direction, forPopup = _action$payload8.forPopup, attachmentId = _action$payload8.attachmentId;
|
|
25995
25633
|
_context43.p = 1;
|
|
25996
25634
|
if (forPopup) {
|
|
25997
25635
|
AttachmentQuery = query.AttachmentByTypeQueryForPopup;
|
|
@@ -26092,8 +25730,8 @@ function loadMoreMessageAttachments(action) {
|
|
|
26092
25730
|
break;
|
|
26093
25731
|
case 21:
|
|
26094
25732
|
_context43.p = 21;
|
|
26095
|
-
|
|
26096
|
-
log.error('error in message attachment query',
|
|
25733
|
+
_t40 = _context43.v;
|
|
25734
|
+
log.error('error in message attachment query', _t40);
|
|
26097
25735
|
case 22:
|
|
26098
25736
|
_context43.p = 22;
|
|
26099
25737
|
_context43.n = 23;
|
|
@@ -26106,7 +25744,7 @@ function loadMoreMessageAttachments(action) {
|
|
|
26106
25744
|
}, _marked37$1, null, [[1, 21, 22, 24]]);
|
|
26107
25745
|
}
|
|
26108
25746
|
function pauseAttachmentUploading(action) {
|
|
26109
|
-
var attachmentId, isPaused,
|
|
25747
|
+
var attachmentId, isPaused, _t41;
|
|
26110
25748
|
return _regenerator().w(function (_context44) {
|
|
26111
25749
|
while (1) switch (_context44.p = _context44.n) {
|
|
26112
25750
|
case 0:
|
|
@@ -26128,15 +25766,15 @@ function pauseAttachmentUploading(action) {
|
|
|
26128
25766
|
break;
|
|
26129
25767
|
case 2:
|
|
26130
25768
|
_context44.p = 2;
|
|
26131
|
-
|
|
26132
|
-
log.error('error in pause attachment uploading',
|
|
25769
|
+
_t41 = _context44.v;
|
|
25770
|
+
log.error('error in pause attachment uploading', _t41);
|
|
26133
25771
|
case 3:
|
|
26134
25772
|
return _context44.a(2);
|
|
26135
25773
|
}
|
|
26136
25774
|
}, _marked38$1, null, [[0, 2]]);
|
|
26137
25775
|
}
|
|
26138
25776
|
function resumeAttachmentUploading(action) {
|
|
26139
|
-
var attachmentId, isResumed,
|
|
25777
|
+
var attachmentId, isResumed, _t42;
|
|
26140
25778
|
return _regenerator().w(function (_context45) {
|
|
26141
25779
|
while (1) switch (_context45.p = _context45.n) {
|
|
26142
25780
|
case 0:
|
|
@@ -26159,15 +25797,15 @@ function resumeAttachmentUploading(action) {
|
|
|
26159
25797
|
break;
|
|
26160
25798
|
case 2:
|
|
26161
25799
|
_context45.p = 2;
|
|
26162
|
-
|
|
26163
|
-
log.error('error in resume attachment uploading',
|
|
25800
|
+
_t42 = _context45.v;
|
|
25801
|
+
log.error('error in resume attachment uploading', _t42);
|
|
26164
25802
|
case 3:
|
|
26165
25803
|
return _context45.a(2);
|
|
26166
25804
|
}
|
|
26167
25805
|
}, _marked39$1, null, [[0, 2]]);
|
|
26168
25806
|
}
|
|
26169
25807
|
function getMessageMarkers(action) {
|
|
26170
|
-
var _action$
|
|
25808
|
+
var _action$payload9, messageId, channelId, deliveryStatuses, sceytChatClient, deliveryStatusesArray, messageMarkers, _iterator4, _step4, deliveryStatus, messageMarkerListQueryBuilder, messageMarkerListQuery, messageMarkersResult, _t43;
|
|
26171
25809
|
return _regenerator().w(function (_context46) {
|
|
26172
25810
|
while (1) switch (_context46.p = _context46.n) {
|
|
26173
25811
|
case 0:
|
|
@@ -26175,7 +25813,7 @@ function getMessageMarkers(action) {
|
|
|
26175
25813
|
_context46.n = 1;
|
|
26176
25814
|
return effects.put(setMessagesMarkersLoadingStateAC(LOADING_STATE.LOADING));
|
|
26177
25815
|
case 1:
|
|
26178
|
-
_action$
|
|
25816
|
+
_action$payload9 = action.payload, messageId = _action$payload9.messageId, channelId = _action$payload9.channelId, deliveryStatuses = _action$payload9.deliveryStatuses;
|
|
26179
25817
|
sceytChatClient = getClient();
|
|
26180
25818
|
if (!sceytChatClient) {
|
|
26181
25819
|
_context46.n = 7;
|
|
@@ -26215,8 +25853,8 @@ function getMessageMarkers(action) {
|
|
|
26215
25853
|
break;
|
|
26216
25854
|
case 8:
|
|
26217
25855
|
_context46.p = 8;
|
|
26218
|
-
|
|
26219
|
-
log.error('error in get message markers',
|
|
25856
|
+
_t43 = _context46.v;
|
|
25857
|
+
log.error('error in get message markers', _t43);
|
|
26220
25858
|
case 9:
|
|
26221
25859
|
_context46.p = 9;
|
|
26222
25860
|
_context46.n = 10;
|
|
@@ -26313,7 +25951,7 @@ function updateMessageOptimisticallyForAddPollVote(channelId, message, vote) {
|
|
|
26313
25951
|
}, _marked42);
|
|
26314
25952
|
}
|
|
26315
25953
|
function addPollVote(action) {
|
|
26316
|
-
var payload, channelId, pollId, optionId, message, isResend, sceytChatClient, _user$presence, user, vote, pendingAction, conflictCheck, channel, _store$getState$Messa2, _currentMessage$pollD, _currentMessage$pollD2, _currentMessage$pollD3, currentMessage, hasNext, obj,
|
|
25954
|
+
var payload, channelId, pollId, optionId, message, isResend, sceytChatClient, _user$presence, user, vote, pendingAction, conflictCheck, channel, _store$getState$Messa2, _currentMessage$pollD, _currentMessage$pollD2, _currentMessage$pollD3, currentMessage, hasNext, obj, _t44;
|
|
26317
25955
|
return _regenerator().w(function (_context49) {
|
|
26318
25956
|
while (1) switch (_context49.p = _context49.n) {
|
|
26319
25957
|
case 0:
|
|
@@ -26403,8 +26041,8 @@ function addPollVote(action) {
|
|
|
26403
26041
|
break;
|
|
26404
26042
|
case 7:
|
|
26405
26043
|
_context49.p = 7;
|
|
26406
|
-
|
|
26407
|
-
log.error('error in add poll vote',
|
|
26044
|
+
_t44 = _context49.v;
|
|
26045
|
+
log.error('error in add poll vote', _t44);
|
|
26408
26046
|
case 8:
|
|
26409
26047
|
return _context49.a(2);
|
|
26410
26048
|
}
|
|
@@ -26486,7 +26124,7 @@ function updateMessageOptimisticallyForDeletePollVote(channelId, message, vote)
|
|
|
26486
26124
|
}, _marked45);
|
|
26487
26125
|
}
|
|
26488
26126
|
function deletePollVote(action) {
|
|
26489
|
-
var payload, channelId, pollId, optionId, message, isResend, sceytChatClient, _message$pollDetails1, _message$pollDetails10, _message$pollDetails11, vote, pendingAction, conflictCheck, channel, _currentMessage$pollD4, _currentMessage$pollD5, _currentMessage$pollD6, currentMessage, obj,
|
|
26127
|
+
var payload, channelId, pollId, optionId, message, isResend, sceytChatClient, _message$pollDetails1, _message$pollDetails10, _message$pollDetails11, vote, pendingAction, conflictCheck, channel, _currentMessage$pollD4, _currentMessage$pollD5, _currentMessage$pollD6, currentMessage, obj, _t45;
|
|
26490
26128
|
return _regenerator().w(function (_context52) {
|
|
26491
26129
|
while (1) switch (_context52.p = _context52.n) {
|
|
26492
26130
|
case 0:
|
|
@@ -26562,8 +26200,8 @@ function deletePollVote(action) {
|
|
|
26562
26200
|
break;
|
|
26563
26201
|
case 8:
|
|
26564
26202
|
_context52.p = 8;
|
|
26565
|
-
|
|
26566
|
-
log.error('error in delete poll vote',
|
|
26203
|
+
_t45 = _context52.v;
|
|
26204
|
+
log.error('error in delete poll vote', _t45);
|
|
26567
26205
|
case 9:
|
|
26568
26206
|
return _context52.a(2);
|
|
26569
26207
|
}
|
|
@@ -26636,7 +26274,7 @@ function updateMessageOptimisticallyForClosePoll(channelId, message) {
|
|
|
26636
26274
|
}, _marked48);
|
|
26637
26275
|
}
|
|
26638
26276
|
function closePoll(action) {
|
|
26639
|
-
var payload, channelId, pollId, message, sceytChatClient, connectionState,
|
|
26277
|
+
var payload, channelId, pollId, message, sceytChatClient, connectionState, _t46;
|
|
26640
26278
|
return _regenerator().w(function (_context55) {
|
|
26641
26279
|
while (1) switch (_context55.p = _context55.n) {
|
|
26642
26280
|
case 0:
|
|
@@ -26671,8 +26309,8 @@ function closePoll(action) {
|
|
|
26671
26309
|
break;
|
|
26672
26310
|
case 4:
|
|
26673
26311
|
_context55.p = 4;
|
|
26674
|
-
|
|
26675
|
-
log.error('error in close poll',
|
|
26312
|
+
_t46 = _context55.v;
|
|
26313
|
+
log.error('error in close poll', _t46);
|
|
26676
26314
|
case 5:
|
|
26677
26315
|
return _context55.a(2);
|
|
26678
26316
|
}
|
|
@@ -26759,7 +26397,7 @@ function updateMessageOptimisticallyForRetractPollVote(channelId, message, objs)
|
|
|
26759
26397
|
}, _marked51);
|
|
26760
26398
|
}
|
|
26761
26399
|
function retractPollVote(action) {
|
|
26762
|
-
var payload, channelId, pollId, message, isResend, sceytChatClient, connectionState, objs, _iterator7, _step7, _message$pollDetails12, _message$pollDetails13, vote,
|
|
26400
|
+
var payload, channelId, pollId, message, isResend, sceytChatClient, connectionState, objs, _iterator7, _step7, _message$pollDetails12, _message$pollDetails13, vote, _t47;
|
|
26763
26401
|
return _regenerator().w(function (_context58) {
|
|
26764
26402
|
while (1) switch (_context58.p = _context58.n) {
|
|
26765
26403
|
case 0:
|
|
@@ -26802,15 +26440,15 @@ function retractPollVote(action) {
|
|
|
26802
26440
|
break;
|
|
26803
26441
|
case 4:
|
|
26804
26442
|
_context58.p = 4;
|
|
26805
|
-
|
|
26806
|
-
log.error('error in retract poll vote',
|
|
26443
|
+
_t47 = _context58.v;
|
|
26444
|
+
log.error('error in retract poll vote', _t47);
|
|
26807
26445
|
case 5:
|
|
26808
26446
|
return _context58.a(2);
|
|
26809
26447
|
}
|
|
26810
26448
|
}, _marked52, null, [[0, 4]]);
|
|
26811
26449
|
}
|
|
26812
26450
|
function resendPendingPollActions(action) {
|
|
26813
|
-
var payload, connectionState, sceytChatClient, pendingPollActionsMap, pendingPollActionsMapCopy,
|
|
26451
|
+
var payload, connectionState, sceytChatClient, pendingPollActionsMap, pendingPollActionsMapCopy, _t48;
|
|
26814
26452
|
return _regenerator().w(function (_context59) {
|
|
26815
26453
|
while (1) switch (_context59.p = _context59.n) {
|
|
26816
26454
|
case 0:
|
|
@@ -26859,15 +26497,15 @@ function resendPendingPollActions(action) {
|
|
|
26859
26497
|
break;
|
|
26860
26498
|
case 2:
|
|
26861
26499
|
_context59.p = 2;
|
|
26862
|
-
|
|
26863
|
-
log.error('error in resend pending poll actions',
|
|
26500
|
+
_t48 = _context59.v;
|
|
26501
|
+
log.error('error in resend pending poll actions', _t48);
|
|
26864
26502
|
case 3:
|
|
26865
26503
|
return _context59.a(2);
|
|
26866
26504
|
}
|
|
26867
26505
|
}, _marked53, null, [[0, 2]]);
|
|
26868
26506
|
}
|
|
26869
26507
|
function resendPendingMessageMutations(action) {
|
|
26870
|
-
var payload, connectionState, pendingMutations, _iterator8, _step8, mutation, currentMutation, channel,
|
|
26508
|
+
var payload, connectionState, pendingMutations, _iterator8, _step8, mutation, currentMutation, channel, _t49, _t50;
|
|
26871
26509
|
return _regenerator().w(function (_context60) {
|
|
26872
26510
|
while (1) switch (_context60.p = _context60.n) {
|
|
26873
26511
|
case 0:
|
|
@@ -26934,7 +26572,7 @@ function resendPendingMessageMutations(action) {
|
|
|
26934
26572
|
break;
|
|
26935
26573
|
case 11:
|
|
26936
26574
|
_context60.p = 11;
|
|
26937
|
-
|
|
26575
|
+
_t49 = _context60.v;
|
|
26938
26576
|
if (isMessageMutationConnected()) {
|
|
26939
26577
|
_context60.n = 12;
|
|
26940
26578
|
break;
|
|
@@ -26947,7 +26585,7 @@ function resendPendingMessageMutations(action) {
|
|
|
26947
26585
|
_context60.n = 14;
|
|
26948
26586
|
return effects.put(removePendingMessageMutationAC(mutation.messageId));
|
|
26949
26587
|
case 14:
|
|
26950
|
-
log.error('error in resend pending message mutations',
|
|
26588
|
+
log.error('error in resend pending message mutations', _t49);
|
|
26951
26589
|
case 15:
|
|
26952
26590
|
_context60.n = 2;
|
|
26953
26591
|
break;
|
|
@@ -26956,15 +26594,15 @@ function resendPendingMessageMutations(action) {
|
|
|
26956
26594
|
break;
|
|
26957
26595
|
case 17:
|
|
26958
26596
|
_context60.p = 17;
|
|
26959
|
-
|
|
26960
|
-
log.error('error in resend pending message mutations',
|
|
26597
|
+
_t50 = _context60.v;
|
|
26598
|
+
log.error('error in resend pending message mutations', _t50);
|
|
26961
26599
|
case 18:
|
|
26962
26600
|
return _context60.a(2);
|
|
26963
26601
|
}
|
|
26964
26602
|
}, _marked54, null, [[7, 11], [0, 17]]);
|
|
26965
26603
|
}
|
|
26966
26604
|
function getPollVotes(action) {
|
|
26967
|
-
var payload, messageId, pollId, optionId, limit, key, SceytChatClient, queryBuilder, pollVotesQuery, result, formattedVotes,
|
|
26605
|
+
var payload, messageId, pollId, optionId, limit, key, SceytChatClient, queryBuilder, pollVotesQuery, result, formattedVotes, _t51;
|
|
26968
26606
|
return _regenerator().w(function (_context61) {
|
|
26969
26607
|
while (1) switch (_context61.p = _context61.n) {
|
|
26970
26608
|
case 0:
|
|
@@ -27030,8 +26668,8 @@ function getPollVotes(action) {
|
|
|
27030
26668
|
break;
|
|
27031
26669
|
case 7:
|
|
27032
26670
|
_context61.p = 7;
|
|
27033
|
-
|
|
27034
|
-
log.error('ERROR in get poll votes',
|
|
26671
|
+
_t51 = _context61.v;
|
|
26672
|
+
log.error('ERROR in get poll votes', _t51);
|
|
27035
26673
|
_context61.n = 8;
|
|
27036
26674
|
return effects.put(setPollVotesLoadingStateAC(action.payload.pollId, action.payload.optionId, LOADING_STATE.LOADED));
|
|
27037
26675
|
case 8:
|
|
@@ -27040,7 +26678,7 @@ function getPollVotes(action) {
|
|
|
27040
26678
|
}, _marked55, null, [[0, 7]]);
|
|
27041
26679
|
}
|
|
27042
26680
|
function loadMorePollVotes(action) {
|
|
27043
|
-
var payload, pollId, optionId, limit, key, pollVotesQuery, result, formattedVotes,
|
|
26681
|
+
var payload, pollId, optionId, limit, key, pollVotesQuery, result, formattedVotes, _t52;
|
|
27044
26682
|
return _regenerator().w(function (_context62) {
|
|
27045
26683
|
while (1) switch (_context62.p = _context62.n) {
|
|
27046
26684
|
case 0:
|
|
@@ -27098,8 +26736,8 @@ function loadMorePollVotes(action) {
|
|
|
27098
26736
|
break;
|
|
27099
26737
|
case 6:
|
|
27100
26738
|
_context62.p = 6;
|
|
27101
|
-
|
|
27102
|
-
log.error('ERROR in load more poll votes',
|
|
26739
|
+
_t52 = _context62.v;
|
|
26740
|
+
log.error('ERROR in load more poll votes', _t52);
|
|
27103
26741
|
_context62.n = 7;
|
|
27104
26742
|
return effects.put(setPollVotesLoadingStateAC(action.payload.pollId, action.payload.optionId, LOADING_STATE.LOADED));
|
|
27105
26743
|
case 7:
|
|
@@ -27109,12 +26747,12 @@ function loadMorePollVotes(action) {
|
|
|
27109
26747
|
}
|
|
27110
26748
|
var REFRESH_WINDOW_HALF = 30;
|
|
27111
26749
|
function refreshCacheAroundMessage(action) {
|
|
27112
|
-
var _action$
|
|
26750
|
+
var _action$payload0, channelId, messageId, _action$payload0$appl, applyVisibleWindow, connectionState, activeChannelId, activeMessages, activeConfirmedMessages, centerMessageIndex, refreshAnchorId, previousLimit, nextLimit, SceytChatClient, messageQueryBuilder, messageQuery, prevResult, pivotId, nextResult, loadedMessages, firstId, lastId, activeById, changed, filteredPendingMessages, _t53, _t54, _t55;
|
|
27113
26751
|
return _regenerator().w(function (_context63) {
|
|
27114
26752
|
while (1) switch (_context63.p = _context63.n) {
|
|
27115
26753
|
case 0:
|
|
27116
26754
|
_context63.p = 0;
|
|
27117
|
-
_action$
|
|
26755
|
+
_action$payload0 = action.payload, channelId = _action$payload0.channelId, messageId = _action$payload0.messageId, _action$payload0$appl = _action$payload0.applyVisibleWindow, applyVisibleWindow = _action$payload0$appl === void 0 ? true : _action$payload0$appl;
|
|
27118
26756
|
connectionState = store.getState().UserReducer.connectionStatus;
|
|
27119
26757
|
if (!(connectionState !== CONNECTION_STATUS.CONNECTED)) {
|
|
27120
26758
|
_context63.n = 1;
|
|
@@ -27165,16 +26803,16 @@ function refreshCacheAroundMessage(action) {
|
|
|
27165
26803
|
_context63.n = 6;
|
|
27166
26804
|
return effects.call(messageQuery.loadPreviousMessageId, refreshAnchorId);
|
|
27167
26805
|
case 6:
|
|
27168
|
-
|
|
26806
|
+
_t53 = _context63.v;
|
|
27169
26807
|
_context63.n = 8;
|
|
27170
26808
|
break;
|
|
27171
26809
|
case 7:
|
|
27172
|
-
|
|
26810
|
+
_t53 = {
|
|
27173
26811
|
messages: [],
|
|
27174
26812
|
hasNext: false
|
|
27175
26813
|
};
|
|
27176
26814
|
case 8:
|
|
27177
|
-
prevResult =
|
|
26815
|
+
prevResult = _t53;
|
|
27178
26816
|
pivotId = prevResult.messages.length > 0 ? getLastConfirmedMessageId(prevResult.messages) : refreshAnchorId;
|
|
27179
26817
|
messageQuery.reverse = false;
|
|
27180
26818
|
messageQuery.limit = nextLimit;
|
|
@@ -27185,16 +26823,16 @@ function refreshCacheAroundMessage(action) {
|
|
|
27185
26823
|
_context63.n = 9;
|
|
27186
26824
|
return effects.call(messageQuery.loadNextMessageId, pivotId);
|
|
27187
26825
|
case 9:
|
|
27188
|
-
|
|
26826
|
+
_t54 = _context63.v;
|
|
27189
26827
|
_context63.n = 11;
|
|
27190
26828
|
break;
|
|
27191
26829
|
case 10:
|
|
27192
|
-
|
|
26830
|
+
_t54 = {
|
|
27193
26831
|
messages: [],
|
|
27194
26832
|
hasNext: false
|
|
27195
26833
|
};
|
|
27196
26834
|
case 11:
|
|
27197
|
-
nextResult =
|
|
26835
|
+
nextResult = _t54;
|
|
27198
26836
|
loadedMessages = [].concat(prevResult.messages, nextResult.messages);
|
|
27199
26837
|
if (!(loadedMessages.length === 0)) {
|
|
27200
26838
|
_context63.n = 12;
|
|
@@ -27209,7 +26847,7 @@ function refreshCacheAroundMessage(action) {
|
|
|
27209
26847
|
setActiveSegment(channelId, firstId, lastId);
|
|
27210
26848
|
}
|
|
27211
26849
|
_context63.n = 13;
|
|
27212
|
-
return effects.call(loadOGMetadataForLinkMessages, loadedMessages, true
|
|
26850
|
+
return effects.call(loadOGMetadataForLinkMessages, loadedMessages, true);
|
|
27213
26851
|
case 13:
|
|
27214
26852
|
if (!sameConfirmedWindow(activeConfirmedMessages, loadedMessages)) {
|
|
27215
26853
|
_context63.n = 15;
|
|
@@ -27251,14 +26889,14 @@ function refreshCacheAroundMessage(action) {
|
|
|
27251
26889
|
return effects.put(addMessagesAC(filteredPendingMessages, MESSAGE_LOAD_DIRECTION.NEXT));
|
|
27252
26890
|
case 18:
|
|
27253
26891
|
_context63.n = 19;
|
|
27254
|
-
return effects.call(loadOGMetadataForLinkMessages, filteredPendingMessages, true
|
|
26892
|
+
return effects.call(loadOGMetadataForLinkMessages, filteredPendingMessages, true);
|
|
27255
26893
|
case 19:
|
|
27256
26894
|
_context63.n = 21;
|
|
27257
26895
|
break;
|
|
27258
26896
|
case 20:
|
|
27259
26897
|
_context63.p = 20;
|
|
27260
|
-
|
|
27261
|
-
log.error('error in refreshCacheAroundMessage',
|
|
26898
|
+
_t55 = _context63.v;
|
|
26899
|
+
log.error('error in refreshCacheAroundMessage', _t55);
|
|
27262
26900
|
case 21:
|
|
27263
26901
|
return _context63.a(2);
|
|
27264
26902
|
}
|
|
@@ -40464,7 +40102,7 @@ var loadFromMetadata$1 = function loadFromMetadata(firstAttachment) {
|
|
|
40464
40102
|
}
|
|
40465
40103
|
var fullMetadata = {
|
|
40466
40104
|
og: {
|
|
40467
|
-
title: compactMeta.ttl,
|
|
40105
|
+
title: compactMeta.ttl || (firstAttachment === null || firstAttachment === void 0 ? void 0 : firstAttachment.name),
|
|
40468
40106
|
description: compactMeta.dsc,
|
|
40469
40107
|
image: compactMeta.iur ? [{
|
|
40470
40108
|
url: compactMeta.iur
|
|
@@ -50883,13 +50521,13 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
50883
50521
|
var urlMetadata = oGMetadata === null || oGMetadata === void 0 ? void 0 : oGMetadata[url];
|
|
50884
50522
|
var metadata = {};
|
|
50885
50523
|
if (urlMetadata) {
|
|
50886
|
-
var _urlMetadata$og, _urlMetadata$og$favic, _urlMetadata$og2, _urlMetadata$og3, _urlMetadata$og3$imag, _urlMetadata$og3$imag2, _urlMetadata$og4;
|
|
50524
|
+
var _urlMetadata$og, _urlMetadata$og$favic, _urlMetadata$og2, _urlMetadata$og$descr, _urlMetadata$og3, _urlMetadata$og3$imag, _urlMetadata$og3$imag2, _urlMetadata$og4, _urlMetadata$og$title;
|
|
50887
50525
|
if (urlMetadata.imageWidth) metadata.szw = urlMetadata.imageWidth;
|
|
50888
50526
|
if (urlMetadata.imageHeight) metadata.szh = urlMetadata.imageHeight;
|
|
50889
50527
|
if ((_urlMetadata$og = urlMetadata.og) !== null && _urlMetadata$og !== void 0 && (_urlMetadata$og$favic = _urlMetadata$og.favicon) !== null && _urlMetadata$og$favic !== void 0 && _urlMetadata$og$favic.url) metadata.tur = urlMetadata.og.favicon.url;
|
|
50890
|
-
if ((_urlMetadata$og2 = urlMetadata.og) !== null && _urlMetadata$og2 !== void 0 && _urlMetadata$og2.description) metadata.dsc = urlMetadata.og.description;
|
|
50528
|
+
if ((_urlMetadata$og2 = urlMetadata.og) !== null && _urlMetadata$og2 !== void 0 && _urlMetadata$og2.description) metadata.dsc = (_urlMetadata$og$descr = urlMetadata.og.description) === null || _urlMetadata$og$descr === void 0 ? void 0 : _urlMetadata$og$descr.slice(0, 200);
|
|
50891
50529
|
if ((_urlMetadata$og3 = urlMetadata.og) !== null && _urlMetadata$og3 !== void 0 && (_urlMetadata$og3$imag = _urlMetadata$og3.image) !== null && _urlMetadata$og3$imag !== void 0 && (_urlMetadata$og3$imag2 = _urlMetadata$og3$imag[0]) !== null && _urlMetadata$og3$imag2 !== void 0 && _urlMetadata$og3$imag2.url) metadata.iur = urlMetadata.og.image[0].url;
|
|
50892
|
-
if ((_urlMetadata$og4 = urlMetadata.og) !== null && _urlMetadata$og4 !== void 0 && _urlMetadata$og4.title) metadata.ttl = urlMetadata.og.title;
|
|
50530
|
+
if ((_urlMetadata$og4 = urlMetadata.og) !== null && _urlMetadata$og4 !== void 0 && _urlMetadata$og4.title) metadata.ttl = (_urlMetadata$og$title = urlMetadata.og.title) === null || _urlMetadata$og$title === void 0 ? void 0 : _urlMetadata$og$title.slice(0, 100);
|
|
50893
50531
|
}
|
|
50894
50532
|
if (dismissedUrls.has(url)) {
|
|
50895
50533
|
metadata.hld = true;
|
|
@@ -50899,7 +50537,8 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
50899
50537
|
data: url,
|
|
50900
50538
|
upload: false
|
|
50901
50539
|
}, Object.keys(metadata).length > 0 ? {
|
|
50902
|
-
metadata: metadata
|
|
50540
|
+
metadata: metadata,
|
|
50541
|
+
name: metadata.ttl
|
|
50903
50542
|
} : {
|
|
50904
50543
|
metadata: {
|
|
50905
50544
|
hld: true
|
|
@@ -50992,13 +50631,13 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
50992
50631
|
var urlMetadata = oGMetadata === null || oGMetadata === void 0 ? void 0 : oGMetadata[url];
|
|
50993
50632
|
var metadata = {};
|
|
50994
50633
|
if (urlMetadata) {
|
|
50995
|
-
var _urlMetadata$og5, _urlMetadata$og5$favi, _urlMetadata$og6, _urlMetadata$og7, _urlMetadata$og7$imag, _urlMetadata$og7$imag2, _urlMetadata$og8;
|
|
50634
|
+
var _urlMetadata$og5, _urlMetadata$og5$favi, _urlMetadata$og6, _urlMetadata$og$descr2, _urlMetadata$og7, _urlMetadata$og7$imag, _urlMetadata$og7$imag2, _urlMetadata$og8, _urlMetadata$og$title2;
|
|
50996
50635
|
if (urlMetadata.imageWidth) metadata.szw = urlMetadata.imageWidth;
|
|
50997
50636
|
if (urlMetadata.imageHeight) metadata.szh = urlMetadata.imageHeight;
|
|
50998
50637
|
if ((_urlMetadata$og5 = urlMetadata.og) !== null && _urlMetadata$og5 !== void 0 && (_urlMetadata$og5$favi = _urlMetadata$og5.favicon) !== null && _urlMetadata$og5$favi !== void 0 && _urlMetadata$og5$favi.url) metadata.tur = urlMetadata.og.favicon.url;
|
|
50999
|
-
if ((_urlMetadata$og6 = urlMetadata.og) !== null && _urlMetadata$og6 !== void 0 && _urlMetadata$og6.description) metadata.dsc = urlMetadata.og.description;
|
|
50638
|
+
if ((_urlMetadata$og6 = urlMetadata.og) !== null && _urlMetadata$og6 !== void 0 && _urlMetadata$og6.description) metadata.dsc = (_urlMetadata$og$descr2 = urlMetadata.og.description) === null || _urlMetadata$og$descr2 === void 0 ? void 0 : _urlMetadata$og$descr2.slice(0, 200);
|
|
51000
50639
|
if ((_urlMetadata$og7 = urlMetadata.og) !== null && _urlMetadata$og7 !== void 0 && (_urlMetadata$og7$imag = _urlMetadata$og7.image) !== null && _urlMetadata$og7$imag !== void 0 && (_urlMetadata$og7$imag2 = _urlMetadata$og7$imag[0]) !== null && _urlMetadata$og7$imag2 !== void 0 && _urlMetadata$og7$imag2.url) metadata.iur = urlMetadata.og.image[0].url;
|
|
51001
|
-
if ((_urlMetadata$og8 = urlMetadata.og) !== null && _urlMetadata$og8 !== void 0 && _urlMetadata$og8.title) metadata.ttl = urlMetadata.og.title;
|
|
50640
|
+
if ((_urlMetadata$og8 = urlMetadata.og) !== null && _urlMetadata$og8 !== void 0 && _urlMetadata$og8.title) metadata.ttl = (_urlMetadata$og$title2 = urlMetadata.og.title) === null || _urlMetadata$og$title2 === void 0 ? void 0 : _urlMetadata$og$title2.slice(0, 100);
|
|
51002
50641
|
}
|
|
51003
50642
|
if (dismissedUrls.has(url)) {
|
|
51004
50643
|
metadata.hld = true;
|
|
@@ -51008,7 +50647,8 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
51008
50647
|
data: url,
|
|
51009
50648
|
upload: false
|
|
51010
50649
|
}, Object.keys(metadata).length > 0 ? {
|
|
51011
|
-
metadata: metadata
|
|
50650
|
+
metadata: metadata,
|
|
50651
|
+
name: metadata.ttl
|
|
51012
50652
|
} : {
|
|
51013
50653
|
metadata: {
|
|
51014
50654
|
hld: true
|
|
@@ -52104,10 +51744,6 @@ var SendMessageInput = function SendMessageInput(_ref3) {
|
|
|
52104
51744
|
imageHeight: e.target.naturalHeight,
|
|
52105
51745
|
imageWidth: e.target.naturalWidth
|
|
52106
51746
|
})));
|
|
52107
|
-
storeMetadata(linkPreview.url, _extends({}, linkPreview.metadata, {
|
|
52108
|
-
imageHeight: e.target.naturalHeight,
|
|
52109
|
-
imageWidth: e.target.naturalWidth
|
|
52110
|
-
}));
|
|
52111
51747
|
}
|
|
52112
51748
|
},
|
|
52113
51749
|
src: linkPreview.metadata.og.image[0].url,
|