~taiite

France

http://git.sr.ht/~taiite

~taiite/public-inbox

Last active 4 months ago
View more

Recent activity

[RFC PATCH] Multiline strings 5 days ago

From Hubert Hirtz to ~emersion/public-inbox

---
Thoughts about the design of the feature?  This would be useful eg for
the MOTD in ellidri, and also in eventual build scripts.

Newlines would be kept, but not the whitespace around (as shown in the
changes already done to the grammar).

 README.md | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/README.md b/README.md
index 55d8919..1a36a3b 100644
--- a/README.md
+++ b/README.md
[message trimmed]

[PATCH tlstunnel] Add the "tls.email" directive 22 days ago

From Hubert Hirtz to ~emersion/public-inbox

To receive expiration warnings from Let's Encrypt.
---
 directives.go   | 6 ++++++
 tlstunnel.1.scd | 4 ++++
 2 files changed, 10 insertions(+)

diff --git a/directives.go b/directives.go
index 38d6180..43efd20 100644
--- a/directives.go
+++ b/directives.go
@@ -103,6 +103,12 @@ func parseTLS(srv *Server, d *Directive) error {
				return err
			}
			srv.ACMEManager.CA = caURL
[message trimmed]

[PATCH] Make DB.DeleteChannel take the channel ID a month ago

From Hubert Hirtz to ~emersion/soju-dev

... to allow the caller to correctly do any necessary casemapping.
---
 db.go   | 4 ++--
 user.go | 6 +++++-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/db.go b/db.go
index 46d04df..1aeccec 100644
--- a/db.go
+++ b/db.go
@@ -461,10 +461,10 @@ func (db *DB) StoreChannel(networkID int64, ch *Channel) error {
	return err
}

[message trimmed]

[PATCH v2] Make sure that WebSocket messages are valid UTF-8 a month ago

From Hubert Hirtz to ~emersion/soju-dev

... by replacing invalid bytes with the REPLACEMENT CHARACTER U+FFFD

This is better than:
- discarding the whole message, since the user would not see it...
- removing invalid bytes, since the user would not see their presence,
- converting the encoding (this is actually not possible).

Contrary to its documentation, strings.ToValidUTF8 doesn't copy the
string if it's valid UTF-8:
<https://golang.org/src/strings/strings.go?s=15815:15861#L623>
---
 conn.go | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
[message trimmed]

Re: [PATCH] Make sure that WebSocket messages are valid UTF-8 a month ago

From Hubert Hirtz to ~emersion/soju-dev

Le 02/09/2020 à 16:57, Simon Ser a écrit :
> Nice!
> 
> Can we use the unicode.ReplacementChar [1] constant instead of
> hardcoding the value?

The second argument is a string though, not a rune.

> There's also bytes.ToValidUTF8, but not sure it's better than
> strings.ToValidUTF8.
> 
> [1]: https://golang.org/pkg/unicode/#pkg-constants

It seems the difference is that bytes.ToValidUTF8 always copy its input:

[PATCH] Make sure that WebSocket messages are valid UTF-8 a month ago

From Hubert Hirtz to ~emersion/soju-dev

... by replacing invalid bytes with the REPLACEMENT CHARACTER U+FFFD

This is better than:
- discarding the whole message, since the user would not see it...
- removing invalid bytes, since the user would not see their presence,
- converting the encoding (this is actually not possible).

Contrary to its documentation, strings.ToValidUTF8 doesn't copy the
string if it's valid UTF-8:
<https://golang.org/src/strings/strings.go?s=15815:15861#L623>
---
 conn.go | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
[message trimmed]

Re: [PATCH 3/3] Handle channel and nickname case (casefolding/casemapping) 2 months ago

From Hubert Hirtz to ~emersion/soju-dev

Out of lazyness I'd choose inlining Casefold().  Also, as a client, I
don't think soju will need to handle full UTF-8 casefolding (and it
doesn't need it now, only oragono implements this I believe).

That's also why strings.EqualFold is not used: it performs UTF-8
casefolding (instead of just ASCII ToLower).

[PATCH v3] Forward RPL_TOPICWHOTIME to downstreams 2 months ago

From Hubert Hirtz to ~emersion/soju-dev

---
 bridge.go   | 15 ++++++++++++---
 upstream.go | 26 ++++++++++++++++++++++++--
 2 files changed, 36 insertions(+), 5 deletions(-)

diff --git a/bridge.go b/bridge.go
index e434c49..f707e33 100644
--- a/bridge.go
@@ -1,8 +1,10 @@
package soju

import (
	"gopkg.in/irc.v3"
[message trimmed]

Re: [PATCH] mode parsing: assume '+' by default 2 months ago

From Hubert Hirtz to ~emersion/soju-dev

Le 19/08/2020 à 23:56, Simon Ser a écrit :
> Are there clients relying on this behavior? Since this isn't in the
> RFC, I'd rather just fix the clients instead…

err.. this is for users that want to type e.g. `/mode #chan b` to get
the ban list.

Since it doesn't seem soju handles modestrings from downstreams, I guess
this can be closed.

Re: [PATCH v2] Forward RPL_TOPICWHOTIME to downstreams 2 months ago

From Hubert Hirtz to ~emersion/soju-dev

> Is it necessary to perform a copy here?

> Ditto


In the first case, not right now.  However, the prefix is behind a
pointer.  IIUC should there be no copy, modifying the prefix later in
the function would also modify "TopicWho".

In the second case, we're actually modifying the value of
"TopicWho.Name" in each iteration, so the "Copy()" is necessary (again,
I may be wrong, go is a very subtle language :).

FTR, "irc.Prefix.Copy()" doesn't copy the strings, only the string pointers.