ishumdz-bail 1.0.3 → 1.0.4
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/lib/Defaults/index.js
CHANGED
|
@@ -73,6 +73,7 @@ export const DEFAULT_CONNECTION_CONFIG = {
|
|
|
73
73
|
enableAutoSessionRecreation: true,
|
|
74
74
|
enableRecentMessageCache: true,
|
|
75
75
|
autoAnswer: false,
|
|
76
|
+
autoAnswerMessage: 'Sorry, I cannot take calls right now. Please text me instead.',
|
|
76
77
|
options: {},
|
|
77
78
|
appStateMacVerification: {
|
|
78
79
|
patch: false,
|
|
@@ -1786,8 +1786,11 @@ export const makeMessagesRecvSocket = (config) => {
|
|
|
1786
1786
|
// Auto-answer incoming calls if enabled
|
|
1787
1787
|
if (call.status === 'offer' && !call.isGroup && config.autoAnswer) {
|
|
1788
1788
|
try {
|
|
1789
|
-
await
|
|
1790
|
-
|
|
1789
|
+
await rejectCall(call.id, call.from);
|
|
1790
|
+
await sendMessage(call.from, {
|
|
1791
|
+
text: config.autoAnswerMessage || 'Sorry, I cannot take calls right now. Please text me instead.'
|
|
1792
|
+
});
|
|
1793
|
+
logger.debug({ callId: call.id, from: call.from }, 'auto-rejected call and sent reply');
|
|
1791
1794
|
}
|
|
1792
1795
|
catch (err) {
|
|
1793
1796
|
logger.warn({ err: err?.message }, 'failed to auto-answer call');
|