Skip to content

Commit e797050

Browse files
committed
.
1 parent 7d02b42 commit e797050

File tree

1 file changed

+36
-40
lines changed

1 file changed

+36
-40
lines changed

scripts/fb_revealDeletedMessages.js

Lines changed: 36 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ export default {
262262
utf8_str.match(/(\\\")(.*?)(\\\")(?=[,)])/g) || []
263263
).map((str) => parse(str));
264264

265-
if (all_strings.length && all_strings.length < 200) {
265+
if (all_strings.length) {
266266
let chats = findAllChatData(all_strings);
267267
chats.length && saveChatData(chats);
268268
}
@@ -286,47 +286,43 @@ export default {
286286
// MWMessageListAttachmentContainer.bs
287287

288288
// TODO hiển thị đúng component react cho từng loại tin nhắn
289-
requireLazy(
290-
["MWV2ChatUnsentMessage.bs", "MWPBaseMessage.bs", "MWV2ChatImage.bs"],
291-
(MWV2ChatUnsentMessage, MWPBaseMessage, MWV2ChatImage) => {
292-
const MWV2ChatUnsentMessageOrig = MWV2ChatUnsentMessage.make;
293-
MWV2ChatUnsentMessage.make = function (a) {
294-
if (a) {
295-
let outgoing = a.outgoing;
296-
let {
297-
isUnsent,
298-
messageId,
299-
threadKey,
300-
offlineThreadingId,
301-
displayedContentTypes,
302-
senderId,
303-
} = a.message;
304-
305-
if (isUnsent) {
306-
threadKey =
307-
UsefulScriptGlobalPageContext.Facebook.decodeArrId(threadKey);
308-
senderId =
309-
UsefulScriptGlobalPageContext.Facebook.decodeArrId(senderId);
310-
311-
let savedMsg = window.ufs_rvdfm_all_msgs.find(
312-
(_) => _.id === messageId
313-
);
314-
315-
a.message.isUnsent = false;
316-
if (savedMsg) {
317-
let time = new Date(savedMsg.saved_time).toLocaleString();
318-
let title = `[Tin thu hồi - ${savedMsg.type}]:\n`;
319-
let text = `${savedMsg?.content}`;
320-
a.message.text = title + text;
321-
} else {
322-
a.message.text = "[Tin thu hồi]: -Không có dữ liệu-";
323-
}
289+
requireLazy(["MWV2ChatUnsentMessage.bs"], (MWV2ChatUnsentMessage) => {
290+
const MWV2ChatUnsentMessageOrig = MWV2ChatUnsentMessage.make;
291+
MWV2ChatUnsentMessage.make = function (a) {
292+
if (a) {
293+
let outgoing = a.outgoing;
294+
let {
295+
isUnsent,
296+
messageId,
297+
threadKey,
298+
offlineThreadingId,
299+
displayedContentTypes,
300+
senderId,
301+
} = a.message;
302+
303+
if (isUnsent) {
304+
threadKey =
305+
UsefulScriptGlobalPageContext.Facebook.decodeArrId(threadKey);
306+
senderId =
307+
UsefulScriptGlobalPageContext.Facebook.decodeArrId(senderId);
308+
309+
let savedMsg = window.ufs_rvdfm_all_msgs.find(
310+
(_) => _.id === messageId
311+
);
312+
313+
a.message.isUnsent = false;
314+
if (savedMsg) {
315+
let title = `[Tin thu hồi - ${savedMsg.type}]:\n`;
316+
let text = `${savedMsg?.content}`;
317+
a.message.text = title + text;
318+
} else {
319+
a.message.text = "[Tin thu hồi]: -Không có dữ liệu-";
324320
}
325321
}
326-
return MWV2ChatUnsentMessageOrig.apply(this, arguments);
327-
};
328-
}
329-
);
322+
}
323+
return MWV2ChatUnsentMessageOrig.apply(this, arguments);
324+
};
325+
});
330326
},
331327

332328
onClick: () => {

0 commit comments

Comments
 (0)