Stop offering a protocol that cannot be added
listProtocols advertised Slack and XMPP alongside the four that work. Neither can be added, and Slack had no arm at all - asking for it fell through to "unknown method", which reads as a client bug rather than as work not yet done. Each protocol now says whether an account can actually be added for it, rather than being dropped from the list: that they are planned is worth telling a client that wants to grey them out, which is what the settings pane already does with its own available flag. Slack now answers with the same "not implemented yet" XMPP always did. Co-Authored-By: Claude Opus 5 <[email protected]>
This commit is contained in:
+18
-7
@@ -76,14 +76,21 @@ pub async fn dispatch(
|
||||
(Some(ok_node()), None)
|
||||
}
|
||||
|
||||
// Every protocol says whether an account can actually be added for
|
||||
// it. Listing the planned ones without that flag was a promise the
|
||||
// daemon could not keep: a client drawing this list offered Slack,
|
||||
// and the add call came back "unknown method" because no such arm
|
||||
// exists. Dropping them instead would lose the fact that they are
|
||||
// planned, which is worth telling a client that wants to grey them
|
||||
// out - the settings pane already does exactly that.
|
||||
"listProtocols" => (
|
||||
Some(serde_json::json!([
|
||||
{ "id": "irc", "name": "IRC" },
|
||||
{ "id": "jabber", "name": "XMPP" },
|
||||
{ "id": "matrix", "name": "Matrix" },
|
||||
{ "id": "discord", "name": "Discord" },
|
||||
{ "id": "slack", "name": "Slack" },
|
||||
{ "id": "sockchat", "name": "Sneedchat" },
|
||||
{ "id": "irc", "name": "IRC", "available": true },
|
||||
{ "id": "matrix", "name": "Matrix", "available": true },
|
||||
{ "id": "discord", "name": "Discord", "available": true },
|
||||
{ "id": "sockchat", "name": "Sneedchat", "available": true },
|
||||
{ "id": "jabber", "name": "XMPP", "available": false },
|
||||
{ "id": "slack", "name": "Slack", "available": false },
|
||||
])),
|
||||
None,
|
||||
),
|
||||
@@ -1345,7 +1352,11 @@ pub async fn dispatch(
|
||||
|
||||
// Net-new protocols land in their own milestones (see project
|
||||
// plan) - not implemented yet.
|
||||
"addXmppAccount" => (None, Some(format!("{method}: not implemented yet"))),
|
||||
//
|
||||
// Slack answers here too. It was advertised by listProtocols with no
|
||||
// arm of its own, so asking for it fell through to "unknown method",
|
||||
// which reads as a client bug rather than as work not yet done.
|
||||
"addXmppAccount" | "addSlackAccount" => (None, Some(format!("{method}: not implemented yet"))),
|
||||
|
||||
// Login (homeserver reachability + m.login.password) can take a
|
||||
// moment - same async-kickoff shape as addSockChatAccount, with
|
||||
|
||||
Reference in New Issue
Block a user