@sockethub/platform-irc 4.0.0-alpha.24 → 4.0.0-alpha.25

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/README.md CHANGED
@@ -18,8 +18,8 @@ messages.
18
18
 
19
19
  ## Usage
20
20
 
21
- IRC room targets use `channel@server` in `target.id` (for example
22
- `general@irc.libera.chat`). When you include `target.name`, use the channel
21
+ IRC room targets use `#channel@server` in `target.id` (for example
22
+ `#general@irc.libera.chat`). When you include `target.name`, use the channel
23
23
  name as it appears on IRC (for example `#general`).
24
24
 
25
25
  ### Send Message Example
@@ -37,7 +37,7 @@ name as it appears on IRC (for example `#general`).
37
37
  "type": "person"
38
38
  },
39
39
  "target": {
40
- "id": "general@irc.libera.chat",
40
+ "id": "#general@irc.libera.chat",
41
41
  "type": "room",
42
42
  "name": "#general"
43
43
  },
@@ -63,7 +63,7 @@ name as it appears on IRC (for example `#general`).
63
63
  "type": "person"
64
64
  },
65
65
  "target": {
66
- "id": "general@irc.libera.chat",
66
+ "id": "#general@irc.libera.chat",
67
67
  "type": "room",
68
68
  "name": "#general"
69
69
  }
@@ -110,7 +110,7 @@ name as it appears on IRC (for example `#general`).
110
110
  "type": "person"
111
111
  },
112
112
  "target": {
113
- "id": "general@irc.libera.chat",
113
+ "id": "#general@irc.libera.chat",
114
114
  "type": "room",
115
115
  "name": "#general"
116
116
  },
@@ -160,7 +160,7 @@ name as it appears on IRC (for example `#general`).
160
160
  "type": "person"
161
161
  },
162
162
  "target": {
163
- "id": "general@irc.libera.chat",
163
+ "id": "#general@irc.libera.chat",
164
164
  "type": "room",
165
165
  "name": "#general"
166
166
  },
@@ -181,7 +181,7 @@ name as it appears on IRC (for example `#general`).
181
181
  "https://sockethub.org/ns/context/platform/irc/v1.jsonld"
182
182
  ],
183
183
  "actor": {
184
- "id": "general@irc.libera.chat",
184
+ "id": "#general@irc.libera.chat",
185
185
  "type": "room",
186
186
  "name": "#general"
187
187
  },
package/dist/index.d.ts CHANGED
@@ -118,13 +118,19 @@ export declare class IRC implements PersistentPlatformInterface {
118
118
  disconnect(job: ActivityStream, done: PlatformCallback): void;
119
119
  cleanup(done: PlatformCallback): any;
120
120
  /**
121
- * Resolve an IRC channel name from a job target. Prefers `target.name`,
122
- * falling back to the channel segment of `target.id` (`<server>/<channel>`).
123
- * Returns undefined when no valid `#channel` can be determined, so callers
124
- * never emit a bare `NAMES` command (which floods the client with the
125
- * server's entire channel list).
121
+ * Resolve an activity target to its IRC recipient (channel or nick).
122
+ *
123
+ * Targets are server-qualified for consistency with what the platform emits
124
+ * (see irc2as): rooms are addressed as `#channel@server` and users
125
+ * (private messages) as
126
+ * `nick@server` — the same `@server` suffix for both. Returns `null` for a
127
+ * `room` target that isn't server-qualified (a bare channel), which callers
128
+ * reject — bare channel names are no longer accepted.
129
+ *
130
+ * @param target activity stream target (`job.target`)
131
+ * @returns the IRC channel (`#channel`) or nick, or `null` for a bare room
126
132
  */
127
- private resolveChannelName;
133
+ private resolveIrcTarget;
128
134
  private isJoined;
129
135
  private hasJoined;
130
136
  private hasLeft;