mezon-js 2.9.16 → 2.9.17

Sign up to get free protection for your applications and to get access to all the features.
@@ -5387,6 +5387,8 @@ var _DefaultSocket = class _DefaultSocket {
5387
5387
  this.onclanprofileupdated(message.clan_profile_updated_event);
5388
5388
  } else if (message.clan_updated_event) {
5389
5389
  this.onclanupdated(message.clan_updated_event);
5390
+ } else if (message.last_seen_message_event) {
5391
+ this.onlastseenupdated(message.last_seen_message_event);
5390
5392
  } else if (message.status_presence_event) {
5391
5393
  this.onstatuspresence(message.status_presence_event);
5392
5394
  } else if (message.stream_presence_event) {
@@ -5675,6 +5677,11 @@ var _DefaultSocket = class _DefaultSocket {
5675
5677
  console.log(clan);
5676
5678
  }
5677
5679
  }
5680
+ onlastseenupdated(event) {
5681
+ if (this.verbose && window && window.console) {
5682
+ console.log(event);
5683
+ }
5684
+ }
5678
5685
  onstreampresence(streamPresence) {
5679
5686
  if (this.verbose && window && window.console) {
5680
5687
  console.log(streamPresence);
@@ -5358,6 +5358,8 @@ var _DefaultSocket = class _DefaultSocket {
5358
5358
  this.onclanprofileupdated(message.clan_profile_updated_event);
5359
5359
  } else if (message.clan_updated_event) {
5360
5360
  this.onclanupdated(message.clan_updated_event);
5361
+ } else if (message.last_seen_message_event) {
5362
+ this.onlastseenupdated(message.last_seen_message_event);
5361
5363
  } else if (message.status_presence_event) {
5362
5364
  this.onstatuspresence(message.status_presence_event);
5363
5365
  } else if (message.stream_presence_event) {
@@ -5646,6 +5648,11 @@ var _DefaultSocket = class _DefaultSocket {
5646
5648
  console.log(clan);
5647
5649
  }
5648
5650
  }
5651
+ onlastseenupdated(event) {
5652
+ if (this.verbose && window && window.console) {
5653
+ console.log(event);
5654
+ }
5655
+ }
5649
5656
  onstreampresence(streamPresence) {
5650
5657
  if (this.verbose && window && window.console) {
5651
5658
  console.log(streamPresence);
package/dist/socket.d.ts CHANGED
@@ -750,6 +750,7 @@ export interface Socket {
750
750
  onchannelupdated: (channelUpdated: ChannelUpdatedEvent) => void;
751
751
  onclanprofileupdated: (clanprofile: ClanProfileUpdatedEvent) => void;
752
752
  onclanupdated: (clan: ClanUpdatedEvent) => void;
753
+ onlastseenupdated: (event: LastSeenMessageEvent) => void;
753
754
  setHeartbeatTimeoutMs(ms: number): void;
754
755
  getHeartbeatTimeoutMs(): number;
755
756
  checkDuplicateName(name: string, condition_id: string, type: number): Promise<CheckNameExistedEvent>;
@@ -834,6 +835,7 @@ export declare class DefaultSocket implements Socket {
834
835
  onchannelupdated(channelUpdated: ChannelUpdatedEvent): void;
835
836
  onclanprofileupdated(clanprofile: ClanProfileUpdatedEvent): void;
836
837
  onclanupdated(clan: ClanUpdatedEvent): void;
838
+ onlastseenupdated(event: LastSeenMessageEvent): void;
837
839
  onstreampresence(streamPresence: StreamPresenceEvent): void;
838
840
  onstreamdata(streamData: StreamData): void;
839
841
  onheartbeattimeout(): void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mezon-js",
3
3
 
4
- "version": "2.9.16",
4
+ "version": "2.9.17",
5
5
 
6
6
  "scripts": {
7
7
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"
package/socket.ts CHANGED
@@ -1110,6 +1110,9 @@ export interface Socket {
1110
1110
  // when clan is updated
1111
1111
  onclanupdated: (clan: ClanUpdatedEvent) => void;
1112
1112
 
1113
+ // when user update last seen message
1114
+ onlastseenupdated: (event: LastSeenMessageEvent) => void;
1115
+
1113
1116
  /* Set the heartbeat timeout used by the socket to detect if it has lost connectivity to the server. */
1114
1117
  setHeartbeatTimeoutMs(ms : number) : void;
1115
1118
 
@@ -1235,35 +1238,37 @@ export class DefaultSocket implements Socket {
1235
1238
  this.onnotification(n);
1236
1239
  });
1237
1240
  } else if (message.voice_started_event) {
1238
- this.onvoicestarted(message.voice_started_event)
1241
+ this.onvoicestarted(message.voice_started_event);
1239
1242
  } else if (message.voice_ended_event) {
1240
- this.onvoiceended(message.voice_ended_event)
1243
+ this.onvoiceended(message.voice_ended_event);
1241
1244
  } else if (message.voice_joined_event) {
1242
- this.onvoicejoined(message.voice_joined_event)
1245
+ this.onvoicejoined(message.voice_joined_event);
1243
1246
  } else if (message.voice_leaved_event) {
1244
- this.onvoiceleaved(message.voice_leaved_event)
1247
+ this.onvoiceleaved(message.voice_leaved_event);
1245
1248
  } else if (message.channel_created_event) {
1246
- this.onchannelcreated(message.channel_created_event)
1249
+ this.onchannelcreated(message.channel_created_event);
1247
1250
  } else if (message.role_event) {
1248
- this.onroleevent(message.role_event)
1249
- } else if(message.event_emoji){
1250
- this.oneventemoji(message.event_emoji)
1251
+ this.onroleevent(message.role_event);
1252
+ } else if(message.event_emoji) {
1253
+ this.oneventemoji(message.event_emoji);
1251
1254
  } else if (message.channel_deleted_event) {
1252
- this.onchanneldeleted(message.channel_deleted_event)
1255
+ this.onchanneldeleted(message.channel_deleted_event);
1253
1256
  } else if (message.clan_deleted_event) {
1254
- this.onclandeleted(message.clan_deleted_event)
1257
+ this.onclandeleted(message.clan_deleted_event);
1255
1258
  } else if (message.sticker_create_event) {
1256
- this.onstickercreated(message.sticker_create_event)
1259
+ this.onstickercreated(message.sticker_create_event);
1257
1260
  } else if (message.sticker_update_event) {
1258
- this.onstickerupdated(message.sticker_update_event)
1261
+ this.onstickerupdated(message.sticker_update_event);
1259
1262
  } else if (message.sticker_delete_event) {
1260
- this.onstickerdeleted(message.sticker_delete_event)
1263
+ this.onstickerdeleted(message.sticker_delete_event);
1261
1264
  } else if (message.channel_updated_event) {
1262
- this.onchannelupdated(message.channel_updated_event)
1265
+ this.onchannelupdated(message.channel_updated_event);
1263
1266
  } else if (message.clan_profile_updated_event) {
1264
- this.onclanprofileupdated(message.clan_profile_updated_event)
1267
+ this.onclanprofileupdated(message.clan_profile_updated_event);
1265
1268
  } else if (message.clan_updated_event) {
1266
- this.onclanupdated(message.clan_updated_event)
1269
+ this.onclanupdated(message.clan_updated_event);
1270
+ } else if (message.last_seen_message_event) {
1271
+ this.onlastseenupdated(message.last_seen_message_event);
1267
1272
  } else if (message.status_presence_event) {
1268
1273
  this.onstatuspresence(<StatusPresenceEvent>message.status_presence_event);
1269
1274
  } else if (message.stream_presence_event) {
@@ -1596,6 +1601,12 @@ export class DefaultSocket implements Socket {
1596
1601
  }
1597
1602
  }
1598
1603
 
1604
+ onlastseenupdated(event: LastSeenMessageEvent) {
1605
+ if (this.verbose && window && window.console) {
1606
+ console.log(event);
1607
+ }
1608
+ }
1609
+
1599
1610
  onstreampresence(streamPresence: StreamPresenceEvent) {
1600
1611
  if (this.verbose && window && window.console) {
1601
1612
  console.log(streamPresence);