mezon-js 2.7.67 → 2.7.69

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.
@@ -4536,6 +4536,8 @@ var _DefaultSocket = class _DefaultSocket {
4536
4536
  this.onmessagereaction(message.message_reaction_event);
4537
4537
  } else if (message.channel_presence_event) {
4538
4538
  this.onchannelpresence(message.channel_presence_event);
4539
+ } else if (message.last_pin_message_event) {
4540
+ this.onpinmessage(message.last_pin_message_event);
4539
4541
  } else {
4540
4542
  if (this.verbose && window && window.console) {
4541
4543
  console.log("Unrecognized message received: %o", message);
@@ -4628,6 +4630,11 @@ var _DefaultSocket = class _DefaultSocket {
4628
4630
  console.log(statusPresence);
4629
4631
  }
4630
4632
  }
4633
+ onpinmessage(pin) {
4634
+ if (this.verbose && window && window.console) {
4635
+ console.log(pin);
4636
+ }
4637
+ }
4631
4638
  onvoiceended(voice) {
4632
4639
  if (this.verbose && window && window.console) {
4633
4640
  console.log(voice);
@@ -4507,6 +4507,8 @@ var _DefaultSocket = class _DefaultSocket {
4507
4507
  this.onmessagereaction(message.message_reaction_event);
4508
4508
  } else if (message.channel_presence_event) {
4509
4509
  this.onchannelpresence(message.channel_presence_event);
4510
+ } else if (message.last_pin_message_event) {
4511
+ this.onpinmessage(message.last_pin_message_event);
4510
4512
  } else {
4511
4513
  if (this.verbose && window && window.console) {
4512
4514
  console.log("Unrecognized message received: %o", message);
@@ -4599,6 +4601,11 @@ var _DefaultSocket = class _DefaultSocket {
4599
4601
  console.log(statusPresence);
4600
4602
  }
4601
4603
  }
4604
+ onpinmessage(pin) {
4605
+ if (this.verbose && window && window.console) {
4606
+ console.log(pin);
4607
+ }
4608
+ }
4602
4609
  onvoiceended(voice) {
4603
4610
  if (this.verbose && window && window.console) {
4604
4611
  console.log(voice);
package/dist/socket.d.ts CHANGED
@@ -79,6 +79,10 @@ export interface LastPinMessageEvent {
79
79
  channel_label: string;
80
80
  /** The unique ID of this message. */
81
81
  message_id: string;
82
+ /** user id */
83
+ user_id: string;
84
+ /** operation */
85
+ operation: number;
82
86
  }
83
87
  /** Last seen message by user */
84
88
  export interface LastSeenMessageEvent {
@@ -444,6 +448,8 @@ export interface Socket {
444
448
  onmessagereaction: (messageReactionEvent: MessageReactionEvent) => void;
445
449
  /** Receive channel presence updates. */
446
450
  onchannelpresence: (channelPresence: ChannelPresenceEvent) => void;
451
+ /** pin message event */
452
+ onpinmessage: (pin: LastPinMessageEvent) => void;
447
453
  onvoicestarted: (voice: VoiceStartedEvent) => void;
448
454
  onvoiceended: (voice: VoiceEndedEvent) => void;
449
455
  onvoicejoined: (voiceParticipant: VoiceJoinedEvent) => void;
@@ -489,6 +495,7 @@ export declare class DefaultSocket implements Socket {
489
495
  onchannelpresence(channelPresence: ChannelPresenceEvent): void;
490
496
  onnotification(notification: Notification): void;
491
497
  onstatuspresence(statusPresence: StatusPresenceEvent): void;
498
+ onpinmessage(pin: LastPinMessageEvent): void;
492
499
  onvoiceended(voice: VoiceEndedEvent): void;
493
500
  onvoicestarted(voice: VoiceStartedEvent): void;
494
501
  onvoicejoined(voiceParticipant: VoiceJoinedEvent): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mezon-js",
3
- "version": "2.7.67",
3
+ "version": "2.7.69",
4
4
  "scripts": {
5
5
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"
6
6
  },
package/socket.ts CHANGED
@@ -98,6 +98,10 @@ export interface LastPinMessageEvent {
98
98
  channel_label: string;
99
99
  /** The unique ID of this message. */
100
100
  message_id: string;
101
+ /** user id */
102
+ user_id: string;
103
+ /** operation */
104
+ operation: number;
101
105
  }
102
106
 
103
107
  /** Last seen message by user */
@@ -614,6 +618,9 @@ export interface Socket {
614
618
  /** Receive channel presence updates. */
615
619
  onchannelpresence: (channelPresence: ChannelPresenceEvent) => void;
616
620
 
621
+ /** pin message event */
622
+ onpinmessage: (pin: LastPinMessageEvent) => void;
623
+
617
624
  // when someone start the voice room
618
625
  onvoicestarted: (voice: VoiceStartedEvent) => void;
619
626
 
@@ -765,6 +772,8 @@ export class DefaultSocket implements Socket {
765
772
  this.onmessagereaction(<MessageReactionEvent>message.message_reaction_event);
766
773
  } else if (message.channel_presence_event) {
767
774
  this.onchannelpresence(<ChannelPresenceEvent>message.channel_presence_event);
775
+ } else if (message.last_pin_message_event) {
776
+ this.onpinmessage(<LastPinMessageEvent>message.last_pin_message_event);
768
777
  } else {
769
778
  if (this.verbose && window && window.console) {
770
779
  console.log("Unrecognized message received: %o", message);
@@ -874,6 +883,12 @@ export class DefaultSocket implements Socket {
874
883
  }
875
884
  }
876
885
 
886
+ onpinmessage(pin: LastPinMessageEvent) {
887
+ if (this.verbose && window && window.console) {
888
+ console.log(pin);
889
+ }
890
+ }
891
+
877
892
  onvoiceended(voice: VoiceEndedEvent) {
878
893
  if (this.verbose && window && window.console) {
879
894
  console.log(voice);