Skip to content

Commit

Permalink
Add the soju.im/no-implicit-names extension
Browse files Browse the repository at this point in the history
  • Loading branch information
emersion committed Mar 14, 2022
1 parent 9376c88 commit 331540f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ func forwardChannel(ctx context.Context, dc *downstreamConn, ch *upstreamChannel
}
}

sendNames(dc, ch)
if !dc.caps["soju.im/no-implicit-names"] {
sendNames(dc, ch)
}
}

func sendTopic(dc *downstreamConn, ch *upstreamChannel) {
Expand Down
13 changes: 13 additions & 0 deletions doc/ext/no-implicit-names.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# no-implicit-names

This is a work-in-progress specification.

## Description

This document describes the `no-implicit-names` extension. This allows clients to opt-out from the implicit `NAMES` reply servers send after `JOIN` messages.

Some clients don't need to query the list of channel members for all joined channels. Omitting this information can reduce the time taken to connect to the server, especially on mobile devices and when a large number of channels are joined.

## Implementation

The `no-implicit-names` extension introduces the `soju.im/no-implicit-names` capability. When negociated, servers MUST NOT send an implicit `NAMES` reply after sending a `JOIN` message. Servers MUST reply to explicit `NAMES` commands sent by the client as usual.
1 change: 1 addition & 0 deletions downstream.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ var permanentDownstreamCaps = map[string]string{
"soju.im/bouncer-networks": "",
"soju.im/bouncer-networks-notify": "",
"soju.im/read": "",
"soju.im/no-implicit-names": "",
}

// needAllDownstreamCaps is the list of downstream capabilities that
Expand Down

0 comments on commit 331540f

Please sign in to comment.