1
0
Fork 0
mirror of https://git.sr.ht/~emersion/gamja synced 2025-04-23 12:33:45 -04:00

wip: use soju.im/search

Closes: https://todo.sr.ht/~emersion/gamja/139
This commit is contained in:
Simon Ser 2022-06-08 15:31:04 +02:00
parent e3c2d85a94
commit cca12d0b95
2 changed files with 16 additions and 0 deletions
components
lib

View file

@ -1101,6 +1101,11 @@ export default class App extends Component {
from = receiptFromMessage(lastMsg);
}
if (client.caps.enabled.has("soju.im/search")) {
// TODO:
return;
}
client.fetchHistoryBetween(target.name, from, to, CHATHISTORY_MAX_SIZE).then((result) => {
for (let msg of result.messages) {
let destBuffers = this.routeMessage(serverID, msg);

View file

@ -24,6 +24,7 @@ const permanentCaps = [
"soju.im/bouncer-networks",
"soju.im/read",
"soju.im/search",
];
const RECONNECT_MIN_DELAY_MSEC = 10 * 1000; // 10s
@ -926,6 +927,16 @@ export default class Client extends EventTarget {
});
}
search(attrs) {
let msg = {
command: "SEARCH",
params: [irc.formatTags(attrs)],
};
return this.fetchBatch(msg, "soju.im/search").then((batch) => {
return batch.messages;
});
}
listBouncerNetworks() {
let req = { command: "BOUNCER", params: ["LISTNETWORKS"] };
return this.fetchBatch(req, "soju.im/bouncer-networks").then((batch) => {