Overview
| Comment: | bump, update workflow, add update reaction code, change paging logic |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | trunk |
| Files: | files | file ages | folders |
| SHA3-256: |
be0b8602d10321789e21c663db166e0a |
| User & Date: | arcade on 2026-04-18 18:31:55.665 |
| Other Links: | manifest | tags |
Context
|
2026-04-18
| ||
| 18:31 | bump, update workflow, add update reaction code, change paging logic leaf check-in: be0b8602d1 user: arcade tags: trunk | |
|
2026-03-30
| ||
| 14:20 | update workflow, get rid of TEXT MardownV2, rewrite handle, add more callbacks check-in: 3fd8c40aa8 user: arcade tags: trunk | |
Changes
Modified .github/workflows/rust-clippy.yml
from [150927a414]
to [d39c325e1d].
1 | name: rust-ci | | | 1 2 3 4 5 6 7 8 9 | name: rust-ci on: push # sccache enable for rust/C builds env: SCCACHE_GHA_ENABLED: "true" RUSTC_WRAPPER: "sccache" jobs: |
| ︙ | ︙ |
Modified Cargo.lock
from [e5a3cb8d14]
to [513db45714].
| ︙ | ︙ | |||
165 166 167 168 169 170 171 | "event-listener", "futures-lite", "rustix", ] [[package]] name = "async-signal" | | | | 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | "event-listener", "futures-lite", "rustix", ] [[package]] name = "async-signal" version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52b5aaafa020cf5053a01f2a60e8ff5dccf550f0f77ec54a4e47285ac2bab485" dependencies = [ "async-io", "async-lock", "atomic-waker", "cfg-if", "futures-core", "futures-io", |
| ︙ | ︙ | |||
246 247 248 249 250 251 252 | name = "autocfg" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" [[package]] name = "aws-lc-rs" | | | | | | 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 | name = "autocfg" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" [[package]] name = "aws-lc-rs" version = "1.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ec6fb3fe69024a75fa7e1bfb48aa6cf59706a101658ea01bfd33b2b248a038f" dependencies = [ "aws-lc-sys", "zeroize", ] [[package]] name = "aws-lc-sys" version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f50037ee5e1e41e7b8f9d161680a725bd1626cb6f8c7e901f91f942850852fe7" dependencies = [ "cc", "cmake", "dunce", "fs_extra", ] |
| ︙ | ︙ | |||
280 281 282 283 284 285 286 | name = "base64ct" version = "1.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06" [[package]] name = "bitflags" | | | | 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 | name = "base64ct" version = "1.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06" [[package]] name = "bitflags" version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4512299f36f043ab09a583e57bceb5a5aab7a73db1805848e8fef3c9e8c78b3" dependencies = [ "serde_core", ] [[package]] name = "block-buffer" version = "0.10.4" |
| ︙ | ︙ | |||
350 351 352 353 354 355 356 | name = "bytes" version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" [[package]] name = "cc" | | | | 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 | name = "bytes" version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" [[package]] name = "cc" version = "1.2.60" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43c5703da9466b66a946814e1adf53ea2c90f10063b86290cc9eb67ce3478a20" dependencies = [ "find-msvc-tools", "jobserver", "libc", "shlex", ] |
| ︙ | ︙ | |||
783 784 785 786 787 788 789 | dependencies = [ "event-listener", "pin-project-lite", ] [[package]] name = "fastrand" | | | | 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 | dependencies = [ "event-listener", "pin-project-lite", ] [[package]] name = "fastrand" version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f1f227452a390804cdb637b74a86990f2a7d7ba4b7d5693aac9b4dd6defd8d6" [[package]] name = "find-msvc-tools" version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" |
| ︙ | ︙ | |||
1022 1023 1024 1025 1026 1027 1028 | "allocator-api2", "equivalent", "foldhash", ] [[package]] name = "hashbrown" | | | | 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 | "allocator-api2", "equivalent", "foldhash", ] [[package]] name = "hashbrown" version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4f467dd6dccf739c208452f8014c75c18bb8301b050ad1cfb27153803edb0f51" [[package]] name = "hashlink" version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7382cf6263419f2d8df38c55d7da83da5c18aef87fc7a7fc1fb1e344edfe14c1" dependencies = [ |
| ︙ | ︙ | |||
1121 1122 1123 1124 1125 1126 1127 | name = "httparse" version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" [[package]] name = "hyper" | | | < | | < | 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 | name = "httparse" version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" [[package]] name = "hyper" version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6299f016b246a94207e63da54dbe807655bf9e00044f73ded42c3ac5305fbcca" dependencies = [ "atomic-waker", "bytes", "futures-channel", "futures-core", "h2", "http", "http-body", "httparse", "itoa", "pin-project-lite", "smallvec", "tokio", "want", ] [[package]] name = "hyper-rustls" version = "0.27.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ca68d021ef39cf6463ab54c1d0f5daf03377b70561305bb89a8f83aab66e0f" dependencies = [ "http", "hyper", "hyper-util", "rustls", "tokio", "tokio-rustls", "tower-service", ] [[package]] name = "hyper-util" |
| ︙ | ︙ | |||
1208 1209 1210 1211 1212 1213 1214 | checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" dependencies = [ "cc", ] [[package]] name = "icu_collections" | | | > | | | | | | | | | | | | | 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 | checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" dependencies = [ "cc", ] [[package]] name = "icu_collections" version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2984d1cd16c883d7935b9e07e44071dca8d917fd52ecc02c04d5fa0b5a3f191c" dependencies = [ "displaydoc", "potential_utf", "utf8_iter", "yoke", "zerofrom", "zerovec", ] [[package]] name = "icu_locale_core" version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92219b62b3e2b4d88ac5119f8904c10f8f61bf7e95b640d25ba3075e6cac2c29" dependencies = [ "displaydoc", "litemap", "tinystr", "writeable", "zerovec", ] [[package]] name = "icu_normalizer" version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c56e5ee99d6e3d33bd91c5d85458b6005a22140021cc324cea84dd0e72cff3b4" dependencies = [ "icu_collections", "icu_normalizer_data", "icu_properties", "icu_provider", "smallvec", "zerovec", ] [[package]] name = "icu_normalizer_data" version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da3be0ae77ea334f4da67c12f149704f19f81d1adf7c51cf482943e84a2bad38" [[package]] name = "icu_properties" version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bee3b67d0ea5c2cca5003417989af8996f8604e34fb9ddf96208a033901e70de" dependencies = [ "icu_collections", "icu_locale_core", "icu_properties_data", "icu_provider", "zerotrie", "zerovec", ] [[package]] name = "icu_properties_data" version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e2bbb201e0c04f7b4b3e14382af113e17ba4f63e2c9d2ee626b720cbce54a14" [[package]] name = "icu_provider" version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "139c4cf31c8b5f33d7e199446eff9c1e02decfc2f0eec2c8d71f65befa45b421" dependencies = [ "displaydoc", "icu_locale_core", "writeable", "yoke", "zerofrom", "zerotrie", |
| ︙ | ︙ | |||
1316 1317 1318 1319 1320 1321 1322 | dependencies = [ "icu_normalizer", "icu_properties", ] [[package]] name = "indexmap" | | | | | | | 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 | dependencies = [ "icu_normalizer", "icu_properties", ] [[package]] name = "indexmap" version = "2.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" dependencies = [ "equivalent", "hashbrown 0.17.0", ] [[package]] name = "ipnet" version = "2.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d98f6fed1fde3f8c21bc40a1abb88dd75e67924f9cffc3ef95607bad8017f8e2" [[package]] name = "iri-string" version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25e659a4bb38e810ebc252e53b5814ff908a8c58c2a9ce2fae1bbec24cbf4e20" dependencies = [ "memchr", "serde", ] [[package]] name = "itoa" |
| ︙ | ︙ | |||
1402 1403 1404 1405 1406 1407 1408 | dependencies = [ "getrandom 0.3.4", "libc", ] [[package]] name = "js-sys" | | | | | | | | | 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 | dependencies = [ "getrandom 0.3.4", "libc", ] [[package]] name = "js-sys" version = "0.3.95" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2964e92d1d9dc3364cae4d718d93f227e3abb088e747d92e0395bfdedf1c12ca" dependencies = [ "cfg-if", "futures-util", "once_cell", "wasm-bindgen", ] [[package]] name = "lazy_static" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" dependencies = [ "spin", ] [[package]] name = "libc" version = "0.2.185" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52ff2c0fe9bc6cb6b14a0592c2ff4fa9ceb83eea9db979b0487cd054946a2b8f" [[package]] name = "libm" version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" [[package]] name = "libredox" version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e02f3bb43d335493c96bf3fd3a321600bf6bd07ed34bc64118e9293bdffea46c" dependencies = [ "bitflags", "libc", "plain", "redox_syscall 0.7.4", ] [[package]] name = "libsqlite3-sys" version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2e99fb7a497b1e3339bc746195567ed8d3e24945ecd636e3619d20b9de9e9149" |
| ︙ | ︙ | |||
1469 1470 1471 1472 1473 1474 1475 | name = "linux-raw-sys" version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" [[package]] name = "litemap" | | | | 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 | name = "linux-raw-sys" version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" [[package]] name = "litemap" version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0" [[package]] name = "lock_api" version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" dependencies = [ |
| ︙ | ︙ | |||
1564 1565 1566 1567 1568 1569 1570 | checksum = "e661dda6640fad38e827a6d4a310ff4763082116fe217f279885c97f511bb0b7" dependencies = [ "lazy_static", "libm", "num-integer", "num-iter", "num-traits", | | | 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 | checksum = "e661dda6640fad38e827a6d4a310ff4763082116fe217f279885c97f511bb0b7" dependencies = [ "lazy_static", "libm", "num-integer", "num-iter", "num-traits", "rand 0.8.6", "smallvec", "zeroize", ] [[package]] name = "num-integer" version = "0.1.46" |
| ︙ | ︙ | |||
1673 1674 1675 1676 1677 1678 1679 | [[package]] name = "pin-project-lite" version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" | < < < < < < | 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 | [[package]] name = "pin-project-lite" version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" [[package]] name = "piper" version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c835479a4443ded371d6c535cbfd8d31ad92c5d23ae9770a61bc155e4992a3c1" dependencies = [ "atomic-waker", |
| ︙ | ︙ | |||
1713 1714 1715 1716 1717 1718 1719 | dependencies = [ "der", "spki", ] [[package]] name = "pkg-config" | | | | 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 | dependencies = [ "der", "spki", ] [[package]] name = "pkg-config" version = "0.3.33" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19f132c84eca552bf34cab8ec81f1c1dcc229b811638f9d283dceabe58c5569e" [[package]] name = "plain" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" |
| ︙ | ︙ | |||
1739 1740 1741 1742 1743 1744 1745 | "pin-project-lite", "rustix", "windows-sys 0.61.2", ] [[package]] name = "potential_utf" | | | | 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 | "pin-project-lite", "rustix", "windows-sys 0.61.2", ] [[package]] name = "potential_utf" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0103b1cef7ec0cf76490e969665504990193874ea05c85ff9bab8b911d0a0564" dependencies = [ "zerovec", ] [[package]] name = "ppv-lite86" version = "0.2.21" |
| ︙ | ︙ | |||
1804 1805 1806 1807 1808 1809 1810 | source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "434b42fec591c96ef50e21e886936e66d3cc3f737104fdb9b737c40ffb94c098" dependencies = [ "aws-lc-rs", "bytes", "getrandom 0.3.4", "lru-slab", | | | 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 | source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "434b42fec591c96ef50e21e886936e66d3cc3f737104fdb9b737c40ffb94c098" dependencies = [ "aws-lc-rs", "bytes", "getrandom 0.3.4", "lru-slab", "rand 0.9.4", "ring", "rustc-hash", "rustls", "rustls-pki-types", "slab", "thiserror 2.0.18", "tinyvec", |
| ︙ | ︙ | |||
1847 1848 1849 1850 1851 1852 1853 | name = "r-efi" version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" [[package]] name = "rand" | | | | | | 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 | name = "r-efi" version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" [[package]] name = "rand" version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5ca0ecfa931c29007047d1bc58e623ab12e5590e8c7cc53200d5202b69266d8a" dependencies = [ "libc", "rand_chacha 0.3.1", "rand_core 0.6.4", ] [[package]] name = "rand" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44c5af06bb1b7d3216d91932aed5265164bf384dc89cd6ba05cf59a35f5f76ea" dependencies = [ "rand_chacha 0.9.0", "rand_core 0.9.5", ] [[package]] name = "rand_chacha" |
| ︙ | ︙ | |||
1915 1916 1917 1918 1919 1920 1921 | checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" dependencies = [ "bitflags", ] [[package]] name = "redox_syscall" | | | | 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 | checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" dependencies = [ "bitflags", ] [[package]] name = "redox_syscall" version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f450ad9c3b1da563fb6948a8e0fb0fb9269711c9c73d9ea1de5058c79c8d643a" dependencies = [ "bitflags", ] [[package]] name = "regex" version = "1.12.3" |
| ︙ | ︙ | |||
2096 2097 2098 2099 2100 2101 2102 | "libc", "linux-raw-sys", "windows-sys 0.61.2", ] [[package]] name = "rustls" | | | | 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 | "libc", "linux-raw-sys", "windows-sys 0.61.2", ] [[package]] name = "rustls" version = "0.23.38" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69f9466fb2c14ea04357e91413efb882e2a6d4a406e625449bc0a5d360d53a21" dependencies = [ "aws-lc-rs", "once_cell", "ring", "rustls-pki-types", "rustls-webpki", "subtle", |
| ︙ | ︙ | |||
2160 2161 2162 2163 2164 2165 2166 | name = "rustls-platform-verifier-android" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f" [[package]] name = "rustls-webpki" | | | | 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 | name = "rustls-platform-verifier-android" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f" [[package]] name = "rustls-webpki" version = "0.103.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8279bb85272c9f10811ae6a6c547ff594d6a7f3c6c6b02ee9726d1d0dcfcdd06" dependencies = [ "aws-lc-rs", "ring", "rustls-pki-types", "untrusted", ] |
| ︙ | ︙ | |||
2240 2241 2242 2243 2244 2245 2246 | checksum = "19411e23596093f03bbd11dc45603b6329bb4bfec77b9fd13e2b9fc9b02efe3e" dependencies = [ "regex", ] [[package]] name = "semver" | | | | 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 | checksum = "19411e23596093f03bbd11dc45603b6329bb4bfec77b9fd13e2b9fc9b02efe3e" dependencies = [ "regex", ] [[package]] name = "semver" version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" [[package]] name = "serde" version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" dependencies = [ |
| ︙ | ︙ | |||
2289 2290 2291 2292 2293 2294 2295 | "serde", "serde_core", "zmij", ] [[package]] name = "serde_spanned" | | | | 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 | "serde", "serde_core", "zmij", ] [[package]] name = "serde_spanned" version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6662b5879511e06e8999a8a235d848113e942c9124f211511b16466ee2995f26" dependencies = [ "serde_core", ] [[package]] name = "serde_urlencoded" version = "0.7.1" |
| ︙ | ︙ | |||
2579 2580 2581 2582 2583 2584 2585 | "hmac", "itoa", "log", "md-5", "memchr", "once_cell", "percent-encoding", | | | 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 | "hmac", "itoa", "log", "md-5", "memchr", "once_cell", "percent-encoding", "rand 0.8.6", "rsa", "serde", "sha1", "sha2", "smallvec", "sqlx-core", "stringprep", |
| ︙ | ︙ | |||
2618 2619 2620 2621 2622 2623 2624 | "hmac", "home", "itoa", "log", "md-5", "memchr", "once_cell", | | | 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 | "hmac", "home", "itoa", "log", "md-5", "memchr", "once_cell", "rand 0.8.6", "serde", "serde_json", "sha2", "smallvec", "sqlx-core", "stringprep", "thiserror 2.0.18", |
| ︙ | ︙ | |||
2750 2751 2752 2753 2754 2755 2756 | dependencies = [ "core-foundation-sys", "libc", ] [[package]] name = "tgbot" | | | | | | 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 | dependencies = [ "core-foundation-sys", "libc", ] [[package]] name = "tgbot" version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef3557c6785bb002ebbd4c2f439cba36d946e5a96b287c2b5180b62459388cc7" dependencies = [ "async-stream", "bytes", "derive_more", "futures-util", "log", "mime", "mime_guess", "reqwest", "serde", "serde_json", "serde_with", "shellwords", "tokio", "tokio-util", ] [[package]] name = "thin-vec" version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "259cdf8ed4e4aca6f1e9d011e10bd53f524a2d0637d7b28450f6c64ac298c4c6" [[package]] name = "thiserror" version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ |
| ︙ | ︙ | |||
2818 2819 2820 2821 2822 2823 2824 | "proc-macro2", "quote", "syn", ] [[package]] name = "tinystr" | | | | 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 | "proc-macro2", "quote", "syn", ] [[package]] name = "tinystr" version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8323304221c2a851516f22236c5722a72eaa19749016521d6dff0824447d96d" dependencies = [ "displaydoc", "zerovec", ] [[package]] name = "tinyvec" |
| ︙ | ︙ | |||
2843 2844 2845 2846 2847 2848 2849 | name = "tinyvec_macros" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" | | | | 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 | name = "tinyvec_macros" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" version = "1.52.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b67dee974fe86fd92cc45b7a95fdd2f99a36a6d7b0d431a231178d3d670bbcc6" dependencies = [ "bytes", "libc", "mio", "pin-project-lite", "socket2", "windows-sys 0.61.2", |
| ︙ | ︙ | |||
2891 2892 2893 2894 2895 2896 2897 | "futures-sink", "pin-project-lite", "tokio", ] [[package]] name = "toml" | | | | | | | | | | 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 | "futures-sink", "pin-project-lite", "tokio", ] [[package]] name = "toml" version = "1.1.2+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81f3d15e84cbcd896376e6730314d59fb5a87f31e4b038454184435cd57defee" dependencies = [ "indexmap", "serde_core", "serde_spanned", "toml_datetime", "toml_parser", "toml_writer", "winnow", ] [[package]] name = "toml_datetime" version = "1.1.1+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3165f65f62e28e0115a00b2ebdd37eb6f3b641855f9d636d3cd4103767159ad7" dependencies = [ "serde_core", ] [[package]] name = "toml_parser" version = "1.1.2+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2abe9b86193656635d2411dc43050282ca48aa31c2451210f4202550afb7526" dependencies = [ "winnow", ] [[package]] name = "toml_writer" version = "1.1.1+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "756daf9b1013ebe47a8776667b466417e2d4c5679d441c26230efd9ef78692db" [[package]] name = "tower" version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" dependencies = [ |
| ︙ | ︙ | |||
3127 3128 3129 3130 3131 3132 3133 | name = "wasi" version = "0.11.1+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] name = "wasip2" | | | | | | | | | | | | | | | | | | | | | 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 | name = "wasi" version = "0.11.1+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] name = "wasip2" version = "1.0.3+wasi-0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "20064672db26d7cdc89c7798c48a0fdfac8213434a1186e5ef29fd560ae223d6" dependencies = [ "wit-bindgen", ] [[package]] name = "wasite" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" [[package]] name = "wasm-bindgen" version = "0.2.118" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bf938a0bacb0469e83c1e148908bd7d5a6010354cf4fb73279b7447422e3a89" dependencies = [ "cfg-if", "once_cell", "rustversion", "wasm-bindgen-macro", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" version = "0.4.68" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f371d383f2fb139252e0bfac3b81b265689bf45b6874af544ffa4c975ac1ebf8" dependencies = [ "js-sys", "wasm-bindgen", ] [[package]] name = "wasm-bindgen-macro" version = "0.2.118" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eeff24f84126c0ec2db7a449f0c2ec963c6a49efe0698c4242929da037ca28ed" dependencies = [ "quote", "wasm-bindgen-macro-support", ] [[package]] name = "wasm-bindgen-macro-support" version = "0.2.118" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d08065faf983b2b80a79fd87d8254c409281cf7de75fc4b773019824196c904" dependencies = [ "bumpalo", "proc-macro2", "quote", "syn", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" version = "0.2.118" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5fd04d9e306f1907bd13c6361b5c6bfc7b3b3c095ed3f8a9246390f8dbdee129" dependencies = [ "unicode-ident", ] [[package]] name = "wasm-streams" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d1ec4f6517c9e11ae630e200b2b65d193279042e28edd4a2cda233e46670bbb" dependencies = [ "futures-util", "js-sys", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", ] [[package]] name = "web-sys" version = "0.3.95" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4f2dfbb17949fa2088e5d39408c48368947b86f7834484e87b73de55bc14d97d" dependencies = [ "js-sys", "wasm-bindgen", ] [[package]] name = "web-time" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" dependencies = [ "js-sys", "wasm-bindgen", ] [[package]] name = "webpki-root-certs" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f31141ce3fc3e300ae89b78c0dd67f9708061d1d2eda54b8209346fd6be9a92c" dependencies = [ "rustls-pki-types", ] [[package]] name = "webpki-roots" version = "0.26.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "521bc38abb08001b01866da9f51eb7c5d647a19260e00054a8c7fd5f9e57f7a9" dependencies = [ "webpki-roots 1.0.7", ] [[package]] name = "webpki-roots" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52f5ee44c96cf55f1b349600768e3ece3a8f26010c05265ab73f945bb1a2eb9d" dependencies = [ "rustls-pki-types", ] [[package]] name = "whoami" version = "1.6.1" |
| ︙ | ︙ | |||
3634 3635 3636 3637 3638 3639 3640 | name = "windows_x86_64_msvc" version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" [[package]] name = "winnow" | | | | | | | | | | | | | | | | | | | | | | | | | | 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 | name = "windows_x86_64_msvc" version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" [[package]] name = "winnow" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09dac053f1cd375980747450bfc7250c264eaae0583872e845c0c7cd578872b5" dependencies = [ "memchr", ] [[package]] name = "wit-bindgen" version = "0.57.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" [[package]] name = "writeable" version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4" [[package]] name = "yoke" version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "abe8c5fda708d9ca3df187cae8bfb9ceda00dd96231bed36e445a1a48e66f9ca" dependencies = [ "stable_deref_trait", "yoke-derive", "zerofrom", ] [[package]] name = "yoke-derive" version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e" dependencies = [ "proc-macro2", "quote", "syn", "synstructure", ] [[package]] name = "zerocopy" version = "0.8.48" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eed437bf9d6692032087e337407a86f04cd8d6a16a37199ed57949d415bd68e9" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" version = "0.8.48" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70e3cd084b1788766f53af483dd21f93881ff30d7320490ec3ef7526d203bad4" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "zerofrom" version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69faa1f2a1ea75661980b013019ed6687ed0e83d069bc1114e2cc74c6c04c4df" dependencies = [ "zerofrom-derive", ] [[package]] name = "zerofrom-derive" version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1" dependencies = [ "proc-macro2", "quote", "syn", "synstructure", ] [[package]] name = "zeroize" version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" [[package]] name = "zerotrie" version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f9152d31db0792fa83f70fb2f83148effb5c1f5b8c7686c3459e361d9bc20bf" dependencies = [ "displaydoc", "yoke", "zerofrom", ] [[package]] name = "zerovec" version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90f911cbc359ab6af17377d242225f4d75119aec87ea711a880987b18cd7b239" dependencies = [ "yoke", "zerofrom", "zerovec-derive", ] [[package]] name = "zerovec-derive" version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555" dependencies = [ "proc-macro2", "quote", "syn", ] [[package]] name = "zmij" version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" |
Modified Cargo.toml
from [7edc9b6d8e]
to [12972fe474].
1 2 3 4 5 6 7 8 9 10 11 12 13 |
[package]
name = "rsstg"
version = "0.6.0"
authors = [ "arcade@b1t.name" ]
edition = "2024"
license = "0BSD"
repository = "http://fs.b1t.name/rsstg"
[dependencies]
async-compat = "0.2.5"
atom_syndication = { version = "0.12.4", features = [ "with-serde" ] }
chrono = "0.4.38"
config = { version = "0.15", default-features = false, features = [ "toml" ] }
| | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
[package]
name = "rsstg"
version = "0.6.0"
authors = [ "arcade@b1t.name" ]
edition = "2024"
license = "0BSD"
repository = "http://fs.b1t.name/rsstg"
[dependencies]
async-compat = "0.2.5"
atom_syndication = { version = "0.12.4", features = [ "with-serde" ] }
chrono = "0.4.38"
config = { version = "0.15", default-features = false, features = [ "toml" ] }
tgbot = "0.44"
futures = "0.3.30"
futures-util = "0.3.30"
lazy_static = "1.5.0"
regex = "1.10.6"
reqwest = { version = "0.13.1", features = [ "brotli", "socks", "deflate" ]}
rss = "2.0.9"
sedregex = "0.2.5"
|
| ︙ | ︙ |
Modified src/command.rs
from [7df81b2fde]
to [adc7f1bfb3].
| ︙ | ︙ | |||
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
use stacked_errors::{
Result,
StackableErr,
bail,
};
use tgbot::types::{
CallbackQuery,
ChatMember,
ChatUsername,
GetChat,
GetChatAdministrators,
Message,
};
use url::Url;
lazy_static! {
static ref RE_USERNAME: Regex = Regex::new(r"^@([a-zA-Z][a-zA-Z0-9_]+)$").unwrap();
static ref RE_IV_HASH: Regex = Regex::new(r"^[a-f0-9]{14}$").unwrap();
| > > | 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
use stacked_errors::{
Result,
StackableErr,
bail,
};
use tgbot::types::{
CallbackQuery,
Chat,
ChatMember,
ChatUsername,
GetChat,
GetChatAdministrators,
MaybeInaccessibleMessage,
Message,
};
use url::Url;
lazy_static! {
static ref RE_USERNAME: Regex = Regex::new(r"^@([a-zA-Z][a-zA-Z0-9_]+)$").unwrap();
static ref RE_IV_HASH: Regex = Regex::new(r"^[a-f0-9]{14}$").unwrap();
|
| ︙ | ︙ | |||
51 52 53 54 55 56 57 |
Ok(())
}
pub async fn test (core: &Core, msg: &Message) -> Result<()> {
let sender: i64 = msg.sender.get_user_id()
.stack_err("Ignoring unreal users.")?.into();
let feeds = core.get_feeds(sender).await.stack()?;
| | | 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
Ok(())
}
pub async fn test (core: &Core, msg: &Message) -> Result<()> {
let sender: i64 = msg.sender.get_user_id()
.stack_err("Ignoring unreal users.")?.into();
let feeds = core.get_feeds(sender).await.stack()?;
let kb = get_kb(&Callback::menu(), &feeds).await.stack()?;
core.tg.send(MyMessage::html_to_kb("Main menu:", msg.chat.get_id(), kb)).await.stack()?;
Ok(())
}
/// Handle channel-management commands that operate on a single numeric source ID.
///
/// This validates that exactly one numeric argument is provided, performs the requested
|
| ︙ | ︙ | |||
199 200 201 202 203 204 205 206 207 208 |
core.tg.send(MyMessage::html_to(update, msg.chat.get_id())).await.stack()?;
if command == "/add" {
if let Some(new_record) = conn.get_one_name(sender, channel).await.stack()? {
core.add_feed(sender.into(), new_record.source_id, new_record.channel).await.stack()?;
} else {
bail!("Failed to read data on freshly inserted source.");
}
};
Ok(())
}
| > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 |
core.tg.send(MyMessage::html_to(update, msg.chat.get_id())).await.stack()?;
if command == "/add" {
if let Some(new_record) = conn.get_one_name(sender, channel).await.stack()? {
core.add_feed(sender.into(), new_record.source_id, new_record.channel).await.stack()?;
} else {
bail!("Failed to read data on freshly inserted source.");
}
};
Ok(())
}
pub async fn answer_cb (core: &Core, query: &CallbackQuery, cb: &str) -> Result<()> {
let cb: Callback = toml::from_str(cb).stack()?;
let sender = &query.from;
//let mut conn = core.db.begin().await.stack()?;
let text = "Sample".to_owned();
if let Some(msg) = &query.message {
match msg {
MaybeInaccessibleMessage::Message(message) => {
if let Some(owner) = message.sender.get_user()
&& sender == owner
{
let feeds = core.get_feeds(owner.id.into()).await.stack()?;
core.tg.update_message(message.chat.get_id().into(), message.id, text, &feeds, cb).await?;
} else {
core.tg.send(MyMessage::html(format!("Can't identify request sender:<br><pre>{:?}</pre>", message))).await.stack()?;
}
},
MaybeInaccessibleMessage::InaccessibleMessage(message) => {
let sender: i64 = sender.id.into();
if let Chat::Private(priv_chat) = &message.chat
&& priv_chat.id == sender
{
let feeds = core.get_feeds(priv_chat.id.into()).await.stack()?;
core.tg.update_message(message.chat.get_id().into(), message.message_id, text, &feeds, cb).await?;
} else {
core.tg.send(MyMessage::html(format!("Can't identify request sender:<br><pre>{:?}</pre>", message))).await.stack()?;
}
},
};
};
Ok(())
}
|
Modified src/core.rs
from [c0605e985c]
to [0d0a1f2581].
| ︙ | ︙ | |||
10 11 12 13 14 15 16 |
},
};
use std::{
borrow::Cow,
collections::{
BTreeMap,
| < | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
},
};
use std::{
borrow::Cow,
collections::{
BTreeMap,
HashSet,
},
time::Duration,
};
use async_compat::Compat;
use chrono::{
|
| ︙ | ︙ | |||
99 100 101 102 103 104 105 |
smol::block_on(async {
let mut set = self.running.lock_arc().await;
set.remove(&self.my_id);
})
}
}
| | | 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
smol::block_on(async {
let mut set = self.running.lock_arc().await;
set.remove(&self.my_id);
})
}
}
pub type FeedList = BTreeMap<i32, String>;
type UserCache = TtlCache<i64, Arc<Mutex<FeedList>>>;
#[derive(Clone)]
pub struct Core {
pub tg: Tg,
pub db: Db,
pub feeds: Arc<Mutex<UserCache>>,
|
| ︙ | ︙ | |||
358 359 360 361 362 363 364 |
/// Returns current cached list of feed for requested user, or loads data from database
pub async fn get_feeds (&self, owner: i64) -> Result<Arc<Mutex<FeedList>>> {
let mut feeds = self.feeds.lock_arc().await;
Ok(match feeds.get(&owner) {
None => {
let mut conn = self.db.begin().await.stack()?;
let feed_list = conn.get_feeds(owner).await.stack()?;
| | | 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 |
/// Returns current cached list of feed for requested user, or loads data from database
pub async fn get_feeds (&self, owner: i64) -> Result<Arc<Mutex<FeedList>>> {
let mut feeds = self.feeds.lock_arc().await;
Ok(match feeds.get(&owner) {
None => {
let mut conn = self.db.begin().await.stack()?;
let feed_list = conn.get_feeds(owner).await.stack()?;
let mut map = BTreeMap::new();
for feed in feed_list {
map.insert(feed.source_id, feed.channel);
};
let res = Arc::new(Mutex::new(map));
feeds.insert(owner, res.clone(), Duration::from_secs(60 * 60 * 3));
res
},
|
| ︙ | ︙ | |||
452 453 454 455 456 457 458 459 |
} else {
// not a command
}
},
UpdateType::CallbackQuery(query) => {
if let Some(ref cb) = query.data
&& let Err(err) = self.cb(&query, cb).await
{
| > < | < | 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 |
} else {
// not a command
}
},
UpdateType::CallbackQuery(query) => {
if let Some(ref cb) = query.data
&& let Err(err) = self.cb(&query, cb).await
&& let Err(err) = self.tg.answer_cb(query.id, err.to_string()).await
{
println!("{err:?}");
}
},
_ => {
println!("Unhandled UpdateKind:\n{update:?}")
},
}
}
}
|
Modified src/tg_bot.rs
from [8222e20590]
to [7753405f16].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
use crate::{
Arc,
Mutex,
core::FeedList,
};
use std::{
borrow::Cow,
fmt,
};
use serde::{
Deserialize,
Serialize,
};
use stacked_errors::{
bail,
Result,
StackableErr,
};
use tgbot::{
| > > > | > > > > | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
use crate::{
Arc,
Mutex,
core::FeedList,
};
use std::{
borrow::Cow,
fmt,
time::Duration,
};
use serde::{
Deserialize,
Serialize,
};
use smol::Timer;
use stacked_errors::{
bail,
Result,
StackableErr,
};
use tgbot::{
api::{
Client,
ExecuteError
},
types::{
AnswerCallbackQuery,
Bot,
ChatPeerId,
EditMessageResult,
EditMessageText,
GetBot,
InlineKeyboardButton,
InlineKeyboardMarkup,
Message,
ParseMode,
SendMessage,
},
};
const CB_VERSION: u8 = 0;
#[derive(Serialize, Deserialize, Debug)]
pub enum Callback {
// Edit one feed (version, name)
Edit(u8, String),
// List all feeds (version, name to show, page number)
List(u8, String, usize),
// Show root menu (version)
Menu(u8),
}
impl Callback {
pub fn edit <S>(text: S) -> Callback
where S: Into<String> {
Callback::Edit(CB_VERSION, text.into())
}
pub fn list <S>(text: S, page: usize) -> Callback
where S: Into<String> {
Callback::List(CB_VERSION, text.into(), page)
}
pub fn menu () -> Callback {
Callback::Menu(CB_VERSION)
}
|
| ︙ | ︙ | |||
72 73 74 75 76 77 78 |
impl fmt::Display for Callback {
fn fmt (&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str(&toml::to_string(self).map_err(|_| fmt::Error)?)
}
}
/// Produce new Keyboard Markup from current Callback
| | | > | < < > | | | 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 |
impl fmt::Display for Callback {
fn fmt (&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str(&toml::to_string(self).map_err(|_| fmt::Error)?)
}
}
/// Produce new Keyboard Markup from current Callback
pub async fn get_kb (cb: &Callback, feeds: &Arc<Mutex<FeedList>>) -> Result<InlineKeyboardMarkup> {
if cb.version() != CB_VERSION {
bail!("Wrong callback version.");
}
let mark = match cb {
Callback::Edit(_, _name) => { // XXX edit missing
let kb: Vec<Vec<InlineKeyboardButton>> = vec![];
InlineKeyboardMarkup::from(kb)
},
Callback::List(_, name, page) => {
let mut kb = vec![];
let feeds = feeds.lock_arc().await;
let long = feeds.len() > 6;
let (start, end) = if long {
(page * 5, 5 + page * 5)
} else {
(0, 6)
};
let mut i = 0;
if name.is_empty() {
let feed_iter = feeds.iter().skip(start);
for (id, name) in feed_iter {
kb.push(vec![
InlineKeyboardButton::for_callback_data(
format!("{}. {}", id, name),
Callback::edit(name).to_string()),
]);
i += 1;
if i == end { break }
}
} else {
let mut found = false;
let mut first_page = None;
for (id, feed_name) in feeds.iter() {
if name == feed_name {
found = true;
}
i += 1;
kb.push(vec![
InlineKeyboardButton::for_callback_data(
format!("{}. {}", id, feed_name),
Callback::list("xxx", *page).to_string()), // XXX edit
]);
if i == end {
// page complete, if found we got the right page, if not - reset and
// continue.
if found {
break
} else {
if first_page.is_none() {
first_page = Some(kb);
|
| ︙ | ︙ | |||
225 226 227 228 229 230 231 232 233 234 235 236 237 238 |
///
/// The function initialises the client, configures the gateway and fetches the bot identity
/// before returning the constructed `Tg`.
pub async fn new (settings: &config::Config) -> Result<Tg> {
let api_key = settings.get_string("api_key").stack()?;
let owner = ChatPeerId::from(settings.get_int("owner").stack()?);
let client = Client::new(&api_key).stack()?
.with_host(settings.get_string("api_gateway").stack()?)
.with_max_retries(0);
let me = client.execute(GetBot).await.stack()?;
Ok(Tg {
me,
owner,
| > > > | 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 |
///
/// The function initialises the client, configures the gateway and fetches the bot identity
/// before returning the constructed `Tg`.
pub async fn new (settings: &config::Config) -> Result<Tg> {
let api_key = settings.get_string("api_key").stack()?;
let owner = ChatPeerId::from(settings.get_int("owner").stack()?);
// We don't use retries, as in async environment this will just get us stuck for extra
// amount of time on simple requests. Just bail, show error and ack it in the code. In
// other case we might got stuck with multiple open transactions in database.
let client = Client::new(&api_key).stack()?
.with_host(settings.get_string("api_gateway").stack()?)
.with_max_retries(0);
let me = client.execute(GetBot).await.stack()?;
Ok(Tg {
me,
owner,
|
| ︙ | ︙ | |||
265 266 267 268 269 270 271 |
pub fn with_owner <O>(&self, owner: O) -> Tg
where O: Into<i64> {
Tg {
owner: ChatPeerId::from(owner.into()),
..self.clone()
}
}
| | > > > > > > > > > > > > > > > > > > > > > > > | 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 |
pub fn with_owner <O>(&self, owner: O) -> Tg
where O: Into<i64> {
Tg {
owner: ChatPeerId::from(owner.into()),
..self.clone()
}
}
pub async fn update_message (&self, chat_id: i64, message_id: i64, text: String, feeds: &Arc<Mutex<FeedList>>, cb: Callback) -> Result<EditMessageResult> {
loop {
let req = EditMessageText::for_chat_message(chat_id, message_id, &text)
.with_reply_markup(get_kb(&cb, feeds).await.stack()?);
let res = self.client.execute(req).await;
match res {
Ok(res) => return Ok(res),
Err(ref err) => {
if let ExecuteError::Response(resp) = err
&& let Some(delay) = resp.retry_after()
{
if delay > 60 {
return res.context("Delay too big (>60), not waiting.");
}
Timer::after(Duration::from_secs(delay)).await;
} else {
return res.context("Can't update message");
}
},
};
}
}
}
|