mikedilger on Nostr: The reason phrase shouldn't be interpreted by software. It can be emtpy. The sole ...
The reason phrase shouldn't be interpreted by software. It can be emtpy. The sole purpose is for humans when humans read the raw protocol. But that PHP library seems to know that. It has hardcoded reason phrases, and uses them if the reason is empty:
```
public function getReasonPhrase(): string
{
$d = self::$codes[$this->code];
return $this->reason ?: $d;
}
```
I think nostr.wine is fine doing what it is doing.
Published at
2025-02-06 18:59:47Event JSON
{
"id": "a550ad40b26c69275e1b038e1832b0981b026df3b91d4ff22985a1f4eec015ef",
"pubkey": "ee11a5dff40c19a555f41fe42b48f00e618c91225622ae37b6c2bb67b76c4e49",
"created_at": 1738868387,
"kind": 1,
"tags": [
[
"p",
"06639a386c9c1014217622ccbcf40908c4f1a0c33e23f8d6d68f4abf655f8f71"
],
[
"p",
"3d842afecd5e293f28b6627933704a3fb8ce153aa91d790ab11f6a752d44a42d"
],
[
"p",
"0dc2dcb14d89f94b8a1590e178e9fbcb2ef1cb0be175a283842f9dc54787801a"
],
[
"p",
"2cef5d547a6dadfb865b258d80b3507ed7be52383bbc1fc0469070b319d7e064"
],
[
"e",
"f3b025f1bc97ae7bfee91695e9f8a2b7789d110375323ea85b832ea3708524d5",
"wss://nos.lol/",
"root"
],
[
"e",
"0ebe426a111575e7e347d597b744395d8cc531746fa6ae8fbfd0d3215f51899d",
"wss://relay.damus.io/",
"reply",
"06639a386c9c1014217622ccbcf40908c4f1a0c33e23f8d6d68f4abf655f8f71"
]
],
"content": "The reason phrase shouldn't be interpreted by software. It can be emtpy. The sole purpose is for humans when humans read the raw protocol. But that PHP library seems to know that. It has hardcoded reason phrases, and uses them if the reason is empty:\n\n```\n public function getReasonPhrase(): string\n {\n $d = self::$codes[$this-\u003ecode];\n return $this-\u003ereason ?: $d;\n }\n```\n\nI think nostr.wine is fine doing what it is doing.",
"sig": "31455574e42e5cea923fc894613366f84e14b6b769bb1a16f8635af5bf45f9b19cb22f93f3db2ae3a3a5be60f380d55dfad293c728c9d896b9cd6dac3bc534c5"
}