whatsapp-pi 1.0.39 → 1.0.40

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "whatsapp-pi",
3
- "version": "1.0.39",
3
+ "version": "1.0.40",
4
4
  "type": "module",
5
5
  "description": "WhatsApp integration extension for Pi",
6
6
  "main": "whatsapp-pi.ts",
@@ -6,6 +6,8 @@ import * as qrcode from 'qrcode-terminal';
6
6
  import type { ExtensionCommandContext } from '@mariozechner/pi-coding-agent';
7
7
 
8
8
  export class MenuHandler {
9
+ private readonly printedAllowedNumbers: string[] = [];
10
+
9
11
  constructor(
10
12
  private readonly whatsappService: WhatsAppService,
11
13
  private readonly sessionManager: SessionManager,
@@ -107,7 +109,7 @@ export class MenuHandler {
107
109
 
108
110
  private async manageAllowedContact(ctx: ExtensionCommandContext, contact: Contact) {
109
111
  const displayName = this.formatAllowedContactOption(contact);
110
- const options = ['Send Message', 'History', 'Print Number'];
112
+ const options = ['Send Message', 'Print Number', 'History'];
111
113
  if (contact.name) {
112
114
  options.push('Remove Alias');
113
115
  } else {
@@ -130,7 +132,7 @@ export class MenuHandler {
130
132
  }
131
133
 
132
134
  if (choice === 'Print Number') {
133
- ctx.ui.notify(contact.number, 'info');
135
+ this.printAllowedNumber(ctx, contact.number);
134
136
  await this.manageAllowedContact(ctx, contact);
135
137
  return;
136
138
  }
@@ -171,6 +173,11 @@ export class MenuHandler {
171
173
  await this.manageAllowList(ctx);
172
174
  }
173
175
 
176
+ private printAllowedNumber(ctx: ExtensionCommandContext, number: string) {
177
+ this.printedAllowedNumbers.push(number);
178
+ ctx.ui.notify(this.printedAllowedNumbers.join('\n'), 'info');
179
+ }
180
+
174
181
  private async manageBlockList(ctx: ExtensionCommandContext) {
175
182
  const list = [...this.sessionManager.getIgnoredNumbers()].reverse();
176
183