mezon-js 2.8.47 → 2.8.48

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.
@@ -4739,11 +4739,13 @@ var _DefaultSocket = class _DefaultSocket {
4739
4739
  this.oncustomstatus(message.custom_status_event);
4740
4740
  } else if (message.user_channel_added_event) {
4741
4741
  this.onuserchanneladded(message.user_channel_added_event);
4742
- } else if (message.user_channel_added_event) {
4743
- this.onuserprofileupdate(message.user_profile_updated_event);
4742
+ } else if (message.add_clan_user_event) {
4743
+ this.onuserclanadded(message.add_clan_user_event);
4744
4744
  } else if (message.user_profile_updated_event) {
4745
- this.onuserchannelremoved(message.user_channel_removed_event);
4745
+ this.onuserprofileupdate(message.user_profile_updated_event);
4746
4746
  } else if (message.user_channel_removed_event) {
4747
+ this.onuserchannelremoved(message.user_channel_removed_event);
4748
+ } else if (message.user_clan_removed_event) {
4747
4749
  this.onuserclanremoved(message.user_clan_removed_event);
4748
4750
  } else {
4749
4751
  if (this.verbose && window && window.console) {
@@ -4832,6 +4834,11 @@ var _DefaultSocket = class _DefaultSocket {
4832
4834
  console.log(user);
4833
4835
  }
4834
4836
  }
4837
+ onuserclanadded(user) {
4838
+ if (this.verbose && window && window.console) {
4839
+ console.log(user);
4840
+ }
4841
+ }
4835
4842
  onuserprofileupdate(user) {
4836
4843
  if (this.verbose && window && window.console) {
4837
4844
  console.log(user);
@@ -4710,11 +4710,13 @@ var _DefaultSocket = class _DefaultSocket {
4710
4710
  this.oncustomstatus(message.custom_status_event);
4711
4711
  } else if (message.user_channel_added_event) {
4712
4712
  this.onuserchanneladded(message.user_channel_added_event);
4713
- } else if (message.user_channel_added_event) {
4714
- this.onuserprofileupdate(message.user_profile_updated_event);
4713
+ } else if (message.add_clan_user_event) {
4714
+ this.onuserclanadded(message.add_clan_user_event);
4715
4715
  } else if (message.user_profile_updated_event) {
4716
- this.onuserchannelremoved(message.user_channel_removed_event);
4716
+ this.onuserprofileupdate(message.user_profile_updated_event);
4717
4717
  } else if (message.user_channel_removed_event) {
4718
+ this.onuserchannelremoved(message.user_channel_removed_event);
4719
+ } else if (message.user_clan_removed_event) {
4718
4720
  this.onuserclanremoved(message.user_clan_removed_event);
4719
4721
  } else {
4720
4722
  if (this.verbose && window && window.console) {
@@ -4803,6 +4805,11 @@ var _DefaultSocket = class _DefaultSocket {
4803
4805
  console.log(user);
4804
4806
  }
4805
4807
  }
4808
+ onuserclanadded(user) {
4809
+ if (this.verbose && window && window.console) {
4810
+ console.log(user);
4811
+ }
4812
+ }
4806
4813
  onuserprofileupdate(user) {
4807
4814
  if (this.verbose && window && window.console) {
4808
4815
  console.log(user);
package/dist/socket.d.ts CHANGED
@@ -71,6 +71,10 @@ interface ChannelLeave {
71
71
  channel_label: string;
72
72
  };
73
73
  }
74
+ export interface AddClanUserEvent {
75
+ clan_id: string;
76
+ user_id: string;
77
+ }
74
78
  /** UserChannelAddedEvent */
75
79
  export interface UserChannelAddedEvent {
76
80
  channel_id: string;
@@ -535,6 +539,8 @@ export interface Socket {
535
539
  onpinmessage: (pin: LastPinMessageEvent) => void;
536
540
  /** Receive added user event */
537
541
  onuserchanneladded: (user: UserChannelAddedEvent) => void;
542
+ /** Receive added user clan event */
543
+ onuserclanadded: (user: AddClanUserEvent) => void;
538
544
  /** Receive update user event */
539
545
  onuserprofileupdate: (user: UserProfileUpdatedEvent) => void;
540
546
  /** Receive channel removed user event */
@@ -599,6 +605,7 @@ export declare class DefaultSocket implements Socket {
599
605
  onchannelmessage(channelMessage: ChannelMessage): void;
600
606
  onchannelpresence(channelPresence: ChannelPresenceEvent): void;
601
607
  onuserchanneladded(user: UserChannelAddedEvent): void;
608
+ onuserclanadded(user: AddClanUserEvent): void;
602
609
  onuserprofileupdate(user: UserProfileUpdatedEvent): void;
603
610
  onuserchannelremoved(user: UserChannelRemovedEvent): void;
604
611
  onuserclanremoved(user: UserClanRemovedEvent): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mezon-js",
3
- "version": "2.8.47",
3
+ "version": "2.8.48",
4
4
  "scripts": {
5
5
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"
6
6
  },
package/socket.ts CHANGED
@@ -88,6 +88,13 @@ interface ChannelLeave {
88
88
  };
89
89
  }
90
90
 
91
+ export interface AddClanUserEvent {
92
+ //the clan id
93
+ clan_id: string;
94
+ // the user id
95
+ user_id: string;
96
+ }
97
+
91
98
  /** UserChannelAddedEvent */
92
99
  export interface UserChannelAddedEvent {
93
100
  // the channel id
@@ -789,6 +796,9 @@ export interface Socket {
789
796
  /** Receive added user event */
790
797
  onuserchanneladded: (user: UserChannelAddedEvent) => void;
791
798
 
799
+ /** Receive added user clan event */
800
+ onuserclanadded: (user: AddClanUserEvent) => void;
801
+
792
802
  /** Receive update user event */
793
803
  onuserprofileupdate: (user: UserProfileUpdatedEvent) => void;
794
804
 
@@ -1012,11 +1022,13 @@ export class DefaultSocket implements Socket {
1012
1022
  this.oncustomstatus(<CustomStatusEvent>message.custom_status_event);
1013
1023
  } else if (message.user_channel_added_event) {
1014
1024
  this.onuserchanneladded(<UserChannelAddedEvent>message.user_channel_added_event);
1015
- } else if (message.user_channel_added_event) {
1016
- this.onuserprofileupdate(<UserProfileUpdatedEvent>message.user_profile_updated_event);
1025
+ } else if (message.add_clan_user_event) {
1026
+ this.onuserclanadded(<AddClanUserEvent>message.add_clan_user_event);
1017
1027
  } else if (message.user_profile_updated_event) {
1018
- this.onuserchannelremoved(<UserChannelRemovedEvent>message.user_channel_removed_event);
1028
+ this.onuserprofileupdate(<UserProfileUpdatedEvent>message.user_profile_updated_event);
1019
1029
  } else if (message.user_channel_removed_event) {
1030
+ this.onuserchannelremoved(<UserChannelRemovedEvent>message.user_channel_removed_event);
1031
+ } else if (message.user_clan_removed_event) {
1020
1032
  this.onuserclanremoved(<UserClanRemovedEvent>message.user_clan_removed_event);
1021
1033
  } else {
1022
1034
  if (this.verbose && window && window.console) {
@@ -1121,6 +1133,12 @@ export class DefaultSocket implements Socket {
1121
1133
  }
1122
1134
  }
1123
1135
 
1136
+ onuserclanadded(user: AddClanUserEvent) {
1137
+ if (this.verbose && window && window.console) {
1138
+ console.log(user);
1139
+ }
1140
+ }
1141
+
1124
1142
  onuserprofileupdate(user: UserProfileUpdatedEvent) {
1125
1143
  if (this.verbose && window && window.console) {
1126
1144
  console.log(user);