Commit f11dca5
committed
coretasks: fix bad WHO loop, update querytype
who_reqs, which is used to track WHO requests to the server, had flipped
keys/values and was never getting cleared upon RPL_ENDOFWHO.
Eventually, this would lead to an endless loop while the bot tried to
get an unused "querytype" (randint) in order to track WHO replies.
This unneccessary loop/check to ensure unique values for the query type was
removed. A RPL_WHOREPLY includes the channel name in the response, so
confirming that the querytype for a channel matched is sufficient.
querytype should be unique _per purpose_. So, now a constant querytype
is used for `coretasks` WHO(X) requests.
Notes:
According to [the closest thing to] official specs:
ircv3/ircv3-specifications#81 (comment)
querytypes should be useful to:
> simplify scripting, in example one could pass a certain value in the query
> and have that value "signal" back what is to be done with those replies.
Also see:
https://github.com/quakenet/snircd/blob/17c92003d376c70db674821e92f2880ba1587132/doc/readme.who#L154
https://github.com/quakenet/snircd/blob/17c92003d376c70db674821e92f2880ba1587132/doc/readme.who#L1051 parent e2d8439 commit f11dca5
1 file changed
+14
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | 31 | | |
33 | 32 | | |
34 | 33 | | |
| |||
45 | 44 | | |
46 | 45 | | |
47 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
48 | 53 | | |
49 | | - | |
50 | 54 | | |
51 | 55 | | |
52 | 56 | | |
| |||
698 | 702 | | |
699 | 703 | | |
700 | 704 | | |
701 | | - | |
702 | | - | |
703 | | - | |
704 | | - | |
705 | | - | |
706 | | - | |
707 | | - | |
708 | | - | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
709 | 711 | | |
710 | 712 | | |
711 | 713 | | |
| |||
1243 | 1245 | | |
1244 | 1246 | | |
1245 | 1247 | | |
1246 | | - | |
| 1248 | + | |
1247 | 1249 | | |
| 1250 | + | |
1248 | 1251 | | |
1249 | 1252 | | |
1250 | 1253 | | |
| |||
1307 | 1310 | | |
1308 | 1311 | | |
1309 | 1312 | | |
1310 | | - | |
1311 | | - | |
1312 | | - | |
1313 | | - | |
1314 | | - | |
1315 | | - | |
1316 | | - | |
1317 | | - | |
1318 | | - | |
1319 | | - | |
1320 | 1313 | | |
1321 | 1314 | | |
1322 | 1315 | | |
| |||
0 commit comments