File tree Expand file tree Collapse file tree
plugins/_whatsapp_integration Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2929 return (config?.allowed_users || []).join(', ');
3030 },
3131 set_allowed(val) {
32- config.allowed_users = val.split(',').map(s => s.trim()).filter(s => s);
32+ config.allowed_users = val.split(',')
33+ .map(s => s.trim().replace(/^\+/, '').replace(/^0+/, ''))
34+ .filter(s => s);
3335 },
3436 async test_connection() {
3537 this.testing = true;
238240 < div class ="field ">
239241 < div class ="field-label ">
240242 < div class ="field-title "> Allowed Users</ div >
241- < div class ="field-description "> International format without + or leading 0< br > e.g. 14155551234 for US +1 . Empty = allow all</ div >
243+ < div class ="field-description "> Use international format without + or leading 0< br > e.g. +1 (415) 555-1234 → 14155551234 . Empty = allow all</ div >
242244 </ div >
243245 < div class ="field-control ">
244- < input type ="text " :value ="allowed_text() " @input ="set_allowed($event.target.value) " placeholder ="14155551234, 447911123456 " />
246+ < input type ="text " :value ="allowed_text() " @change ="set_allowed($event.target.value) " placeholder ="14155551234, 447911123456 " />
245247 </ div >
246248 </ div >
247249
Original file line number Diff line number Diff line change @@ -200,7 +200,10 @@ async function startSocket() {
200200 // Check allowlist (resolve LID -> phone if needed)
201201 if ( ! msg . key . fromMe && ALLOWED_USERS . length > 0 ) {
202202 const resolvedNumber = lidToPhone [ senderNumber ] || senderNumber ;
203- if ( ! ALLOWED_USERS . includes ( resolvedNumber ) ) continue ;
203+ if ( ! ALLOWED_USERS . includes ( resolvedNumber ) ) {
204+ console . log ( `[bridge] Ignored message from ${ resolvedNumber } (not in allowed users)` ) ;
205+ continue ;
206+ }
204207 }
205208
206209 // Unwrap documentWithCaptionMessage (Baileys wraps captioned docs)
You can’t perform that action at this time.
0 commit comments