@badgerclaw/connect 1.3.0 → 1.3.1

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": "@badgerclaw/connect",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "BadgerClaw channel plugin for OpenClaw",
5
5
  "type": "module",
6
6
  "dependencies": {
package/room-config.json CHANGED
@@ -1,5 +1,8 @@
1
1
  {
2
2
  "!oVrHNyMFgnOCfmjlLU:badger.signout.io": {
3
3
  "autoReply": true
4
+ },
5
+ "!hcLBnfZOzoIHENRxuU:badger.signout.io": {
6
+ "autoReply": true
4
7
  }
5
8
  }
@@ -57,6 +57,25 @@ export function registerMatrixAutoJoin(params: {
57
57
  // Ignore sync errors
58
58
  }
59
59
  })();
60
+
61
+ // When bot joins a new room, send a presence message to force Megolm session rotation
62
+ // This ensures all clients create a new session that includes the bot's device
63
+ client.on("room.join", async (roomId: string) => {
64
+ logVerbose(`badgerclaw: bot joined room ${roomId}, requesting key share`);
65
+ try {
66
+ // Send a dummy state event to signal our device presence
67
+ // This forces clients to include our device in the next Megolm session
68
+ await client.sendStateEvent(roomId, "m.room.member", await client.getUserId(), {
69
+ membership: "join",
70
+ displayname: "testbot",
71
+ }).catch(() => {});
72
+
73
+ // Also send a notice message to trigger session rotation
74
+ await client.sendNotice(roomId, "🦡 Bot connected to this room.").catch(() => {});
75
+ } catch (err) {
76
+ logVerbose(`badgerclaw: failed to send join notice in ${roomId}: ${err}`);
77
+ }
78
+ });
60
79
  return;
61
80
  }
62
81