polfan-server-js-client 0.2.35 → 0.2.37

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.
@@ -4,7 +4,9 @@
4
4
  <option name="autoReloadType" value="SELECTIVE" />
5
5
  </component>
6
6
  <component name="ChangeListManager">
7
- <list default="true" id="831dae43-0da1-47fd-a5f7-33dd5eec2992" name="Changes" comment="Dedicated event for user status change" />
7
+ <list default="true" id="831dae43-0da1-47fd-a5f7-33dd5eec2992" name="Changes" comment="Fix update the latest message in a room default topic">
8
+ <change beforePath="$PROJECT_DIR$/src/FilesClient.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/FilesClient.ts" afterDir="false" />
9
+ </list>
8
10
  <option name="SHOW_DIALOG" value="false" />
9
11
  <option name="HIGHLIGHT_CONFLICTS" value="true" />
10
12
  <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
@@ -100,6 +102,11 @@
100
102
  <workItem from="1751060147554" duration="143000" />
101
103
  <workItem from="1751159757238" duration="782000" />
102
104
  <workItem from="1751539766803" duration="1251000" />
105
+ <workItem from="1751551622570" duration="125000" />
106
+ <workItem from="1751561070286" duration="2044000" />
107
+ <workItem from="1751802125669" duration="1542000" />
108
+ <workItem from="1751811595978" duration="792000" />
109
+ <workItem from="1752705788150" duration="3121000" />
103
110
  </task>
104
111
  <task id="LOCAL-00001" summary="Emoticons objects">
105
112
  <option name="closed" value="true" />
@@ -397,7 +404,23 @@
397
404
  <option name="project" value="LOCAL" />
398
405
  <updated>1751547708628</updated>
399
406
  </task>
400
- <option name="localTasksCounter" value="38" />
407
+ <task id="LOCAL-00038" summary="Dedicated event for user status change">
408
+ <option name="closed" value="true" />
409
+ <created>1751551734548</created>
410
+ <option name="number" value="00038" />
411
+ <option name="presentableId" value="LOCAL-00038" />
412
+ <option name="project" value="LOCAL" />
413
+ <updated>1751551734548</updated>
414
+ </task>
415
+ <task id="LOCAL-00039" summary="Fix update the latest message in a room default topic">
416
+ <option name="closed" value="true" />
417
+ <created>1751562062024</created>
418
+ <option name="number" value="00039" />
419
+ <option name="presentableId" value="LOCAL-00039" />
420
+ <option name="project" value="LOCAL" />
421
+ <updated>1751562062024</updated>
422
+ </task>
423
+ <option name="localTasksCounter" value="40" />
401
424
  <servers />
402
425
  </component>
403
426
  <component name="TypeScriptGeneratedFilesManager">
@@ -437,6 +460,7 @@
437
460
  <MESSAGE value="Fix package.json type exports" />
438
461
  <MESSAGE value="New message type" />
439
462
  <MESSAGE value="Dedicated event for user status change" />
440
- <option name="LAST_COMMIT_MESSAGE" value="Dedicated event for user status change" />
463
+ <MESSAGE value="Fix update the latest message in a room default topic" />
464
+ <option name="LAST_COMMIT_MESSAGE" value="Fix update the latest message in a room default topic" />
441
465
  </component>
442
466
  </project>
@@ -1179,11 +1179,20 @@ class RoomsManager {
1179
1179
  handleNewMessage(ev) {
1180
1180
  const topics = this.topics.get(ev.message.location.roomId);
1181
1181
  const topic = topics?.get(ev.message.location.topicId);
1182
- if (topic) {
1183
- topics.set({
1184
- ...topic,
1185
- messageCount: topic.messageCount + 1,
1186
- lastMessage: ev.message
1182
+ if (!topic) {
1183
+ return; // No topic found, nothing to update
1184
+ }
1185
+ const newTopic = {
1186
+ ...topic,
1187
+ messageCount: topic.messageCount + 1,
1188
+ lastMessage: ev.message
1189
+ };
1190
+ topics.set(newTopic);
1191
+ const room = this.list.get(ev.message.location.roomId);
1192
+ if (room.defaultTopic?.id === ev.message.location.topicId) {
1193
+ this.list.set({
1194
+ ...room,
1195
+ defaultTopic: newTopic
1187
1196
  });
1188
1197
  }
1189
1198
  }
@@ -2226,7 +2235,7 @@ function FilesClient_toPrimitive(input, hint) { if (typeof input !== "object" ||
2226
2235
  class FilesClient extends AbstractRestClient {
2227
2236
  constructor(...args) {
2228
2237
  super(...args);
2229
- FilesClient_defineProperty(this, "defaultUrl", 'https://polfan.pl/webservice/api/files');
2238
+ FilesClient_defineProperty(this, "defaultUrl", 'https://files.devana.pl/files');
2230
2239
  }
2231
2240
  async uploadFile(file) {
2232
2241
  const formData = new FormData();
@@ -2242,9 +2251,14 @@ class FilesClient extends AbstractRestClient {
2242
2251
  });
2243
2252
  return this.convertFetchResponse(response);
2244
2253
  }
2245
- async getFileMetadata(id) {
2254
+ async getFileMeta(id) {
2246
2255
  return this.send('GET', '/' + id);
2247
2256
  }
2257
+ async getFileMetaBulk(ids) {
2258
+ const searchParams = new URLSearchParams();
2259
+ ids.forEach(id => searchParams.append('id[]', id));
2260
+ return this.send('GET', '?' + searchParams);
2261
+ }
2248
2262
  }
2249
2263
  ;// CONCATENATED MODULE: ./src/index.ts
2250
2264