Browse code

[add] progation of events "join", "part", "kick", "quit"

Christian FraƟ authored on20/11/2021 16:04:23
Showing1 changed files
... ...
@@ -232,7 +232,6 @@ async function execute
232 232
 					"names",
233 233
 					(channel, users) =>
234 234
 					{
235
-						
236 235
 						connection.eventqueue.push
237 236
 						({
238 237
 							"timestamp": get_timestamp(),
... ...
@@ -242,6 +241,58 @@ async function execute
242 241
 					}
243 242
 				);
244 243
 				client.addListener
244
+				(
245
+					"join",
246
+					(channel, nick, message) =>
247
+					{
248
+						connection.eventqueue.push
249
+						({
250
+							"timestamp": get_timestamp(),
251
+							"kind": "user_joined",
252
+							"data": {"channel": channel, "user_name": nick}
253
+						});
254
+					}
255
+				);
256
+				client.addListener
257
+				(
258
+					"part",
259
+					(channel, nick, reason, message) =>
260
+					{
261
+						connection.eventqueue.push
262
+						({
263
+							"timestamp": get_timestamp(),
264
+							"kind": "user_parted",
265
+							"data": {"channel": channel, "user_name": nick}
266
+						});
267
+					}
268
+				);
269
+				client.addListener
270
+				(
271
+					"kick",
272
+					(channel, nick, by, reason, message) =>
273
+					{
274
+						connection.eventqueue.push
275
+						({
276
+							"timestamp": get_timestamp(),
277
+							"kind": "user_kicked",
278
+							"data": {"channel": channel, "user_name": nick, "op_name": by, "reason": reason}
279
+						});
280
+					}
281
+				);
282
+				client.addListener
283
+				(
284
+					"quit",
285
+					(nick, reason, channels, message) =>
286
+					{
287
+						connection.eventqueue.push
288
+						({
289
+							"timestamp": get_timestamp(),
290
+							"kind": "user_quit",
291
+							"data": {"name": nick, "channels": channels}
292
+						});
293
+					}
294
+				);
295
+				client.addListener
245 296
 				(
246 297
 					"error",
247 298
 					(error) =>