Overview
| Comment: | comments, reordering, better paging |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA3-256: |
374eadef45f782806bea6e38e9949b1a |
| User & Date: | arcade on 2026-03-28 13:24:23.995 |
| Other Links: | manifest | tags |
Context
|
2026-03-30
| ||
| 14:20 | update workflow, get rid of TEXT MardownV2, rewrite handle, add more callbacks check-in: 3fd8c40aa8 user: arcade tags: trunk | |
|
2026-03-28
| ||
| 13:24 | comments, reordering, better paging check-in: 374eadef45 user: arcade tags: trunk | |
|
2026-03-25
| ||
| 19:11 | bump, rewrite sending, add feed fetching and test keyboard check-in: 9adc69d514 user: arcade tags: trunk | |
Changes
Modified Cargo.lock
from [76b1664067]
to [e5a3cb8d14].
| ︙ | |||
256 257 258 259 260 261 262 | 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 | - + - + | dependencies = [ "aws-lc-sys", "zeroize", ] [[package]] name = "aws-lc-sys" |
| ︙ | |||
350 351 352 353 354 355 356 | 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" |
| ︙ | |||
394 395 396 397 398 399 400 | 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 | - + - + | "serde", "wasm-bindgen", "windows-link", ] [[package]] name = "cmake" |
| ︙ | |||
1402 1403 1404 1405 1406 1407 1408 | 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 | - + - + + + | dependencies = [ "getrandom 0.3.4", "libc", ] [[package]] name = "js-sys" |
| ︙ | |||
1536 1537 1538 1539 1540 1541 1542 | 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 | - + - + | dependencies = [ "adler2", "simd-adler32", ] [[package]] name = "mio" |
| ︙ | |||
2066 2067 2068 2069 2070 2071 2072 | 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 | - + - + | "toml", "ttl_cache", "url", ] [[package]] name = "rustc-hash" |
| ︙ | |||
2388 2389 2390 2391 2392 2393 2394 | 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 | - + - + | dependencies = [ "digest", "rand_core 0.6.4", ] [[package]] name = "simd-adler32" |
| ︙ | |||
3140 3141 3142 3143 3144 3145 3146 | 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 | - + - + - + - + - - - - - + - + - + - + - + - + - + - + | name = "wasite" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" [[package]] name = "wasm-bindgen" |
| ︙ |
Modified src/command.rs
from [1c02a4422c]
to [46db96910f].
| ︙ | |||
51 52 53 54 55 56 57 | 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | - + |
}
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::list("", 0), feeds).await.stack()?;
|
| ︙ | |||
80 81 82 83 84 85 86 87 | 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | + - + |
Err(err) => format!("I need a number.\n{}", &err).into(),
Ok(number) => match command {
"/check" => core.check(number, false, None).await
.context("Channel check failed.")?.into(),
"/clean" => conn.clean(number, sender).await.stack()?,
"/enable" => conn.enable(number, sender).await.stack()?.into(),
"/delete" => {
let res = conn.delete(number, sender).await.stack()?;
core.rm_feed(sender.into(), &number).await.stack()?;
|
| ︙ |
Modified src/core.rs
from [d0a8570642]
to [1e3d90a7dd].
| ︙ | |||
359 360 361 362 363 364 365 | 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 | - + |
reply.push(row.to_string());
};
Ok(reply.join("\n\n"))
}
/// 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<HashMap<i32, String>>>> {
|
| ︙ | |||
388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 | 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 | + + + |
if let Some(feed) = feeds.get_mut(&owner) {
let mut feed = feed.lock_arc().await;
feed.insert(source_id, channel);
} else {
inserted = false;
}
}
// in case insert failed - we miss the entry we needed to expand, reload everything from
// database
if !inserted {
self.get_feeds(owner).await.stack()?;
}
Ok(())
}
/// Removes feed from cached list
pub async fn rm_feed (&self, owner: i64, source_id: &i32) -> Result<()> {
let mut dropped = false;
{
let mut feeds = self.feeds.lock_arc().await;
if let Some(feed) = feeds.get_mut(&owner) {
let mut feed = feed.lock_arc().await;
feed.remove(source_id);
dropped = true;
}
}
// in case we failed to found feed we need to remove - just reload everything from database
if !dropped {
self.get_feeds(owner).await.stack()?;
}
Ok(())
}
}
|
| ︙ |
Modified src/sql.rs
from [9eecbf4b17]
to [adaf777be6].
| ︙ | |||
232 233 234 235 236 237 238 239 240 241 242 243 244 245 | 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 | + |
where I: Into<i64> {
sqlx::query("update rsstg_source set last_scrape = now() where source_id = $1;")
.bind(id.into())
.execute(&mut *self.0).await.stack()?;
Ok(())
}
#[allow(clippy::too_many_arguments)] // XXX at least for now…
pub async fn update <I> (&mut self, update: Option<i32>, channel: &str, channel_id: i64, url: &str, iv_hash: Option<&str>, url_re: Option<&str>, owner: I) -> Result<&str>
where I: Into<i64> {
match match update {
Some(id) => {
sqlx::query("update rsstg_source set channel_id = $2, url = $3, iv_hash = $4, owner = $5, channel = $6, url_re = $7 where source_id = $1")
.bind(id)
},
|
| ︙ |
Modified src/tg_bot.rs
from [1f396dc2e6]
to [90448b5782].
| ︙ | |||
70 71 72 73 74 75 76 | 70 71 72 73 74 75 76 77 78 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 | + - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + - - - + + + + + + + + |
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() {
|
| ︙ |