Commit Graph

54 Commits

Author SHA1 Message Date
mlctrez 504c66f7c1 make outbox.state same as client.state to allow persisting last message retrieved (#168)
After testing quite a bit on the saltyim/app client, I tracked down why all outbox messages were being pulled every time a new client starts up.

I believe the outbox client state should be shared with the parent client to allow the last message retrieved from the oubox to be persisted.

Co-authored-by: mlctrez <mlctrez@gmail.com>
Reviewed-on: https://git.mills.io/saltyim/saltyim/pulls/168
Reviewed-by: James Mills <james@mills.io>
Co-authored-by: mlctrez <mlctrez@noreply@mills.io>
Co-committed-by: mlctrez <mlctrez@noreply@mills.io>
2022-04-29 21:59:40 +00:00
mlctrez 364743abf5 fix issue with shared outbox and endpoint modification (#160)
Fixes two issues

cli.me.key.Private() was always nil, outbox hash was the same for everyone 👎

client.Outbox() modified Path variable on endpoint url

Co-authored-by: mlctrez <mlctrez@gmail.com>
Reviewed-on: https://git.mills.io/saltyim/saltyim/pulls/160
Reviewed-by: xuu <xuu@noreply@mills.io>
Reviewed-by: James Mills <james@mills.io>
Co-authored-by: mlctrez <mlctrez@noreply@mills.io>
Co-committed-by: mlctrez <mlctrez@noreply@mills.io>
2022-04-08 15:30:02 +00:00
mlctrez fcc4f53f20 navigation drawer is now fixed for > 900px windows (#157)
Co-authored-by: mlctrez <mlctrez@gmail.com>
Reviewed-on: https://git.mills.io/saltyim/saltyim/pulls/157
Reviewed-by: James Mills <james@mills.io>
Co-authored-by: mlctrez <mlctrez@noreply@mills.io>
Co-committed-by: mlctrez <mlctrez@noreply@mills.io>
2022-04-07 03:43:09 +00:00
James Mills fce6c97259 Upgrade to msgbus v0.1.18 (#153)
Co-authored-by: James Mills <prologic@shortcircuit.net.au>
Reviewed-on: https://git.mills.io/saltyim/saltyim/pulls/153
2022-04-05 03:10:29 +00:00
James Mills 832fb124fe Improve the registration process, add feedback to the PWA's UX adn use an API for registration (#147)
Co-authored-by: James Mills <prologic@shortcircuit.net.au>
Reviewed-on: https://git.mills.io/saltyim/saltyim/pulls/147
Reviewed-by: xuu <xuu@noreply@mills.io>
Co-authored-by: James Mills <james@mills.io>
Co-committed-by: James Mills <james@mills.io>
2022-04-04 16:04:38 +00:00
James Mills 330701da86 Fix SendToAddr to error when no sender configured (#149)
Fixes #145

Co-authored-by: James Mills <prologic@shortcircuit.net.au>
Reviewed-on: https://git.mills.io/saltyim/saltyim/pulls/149
Reviewed-by: xuu <xuu@noreply@mills.io>
Co-authored-by: James Mills <james@mills.io>
Co-committed-by: James Mills <james@mills.io>
2022-04-04 15:38:59 +00:00
James Mills f3a847674c Add support for state for Service{} (#142)
Co-authored-by: James Mills <prologic@shortcircuit.net.au>
Reviewed-on: https://git.mills.io/saltyim/saltyim/pulls/142
2022-04-04 03:42:54 +00:00
James Mills 00a11f20fd Fix broken client inbox state persistence (#141)
Co-authored-by: James Mills <prologic@shortcircuit.net.au>
Reviewed-on: https://git.mills.io/saltyim/saltyim/pulls/141
2022-04-04 02:03:52 +00:00
James Mills 237dce3664 Fixes live from @ullarah 😅 (#135)
Co-authored-by: James Mills <prologic@shortcircuit.net.au>
Reviewed-on: https://git.mills.io/saltyim/saltyim/pulls/135
2022-04-03 09:46:28 +00:00
James Mills b3ce088a8e Remove inbox index state persistence (for now) (#134)
Until https://git.mills.io/prologic/msgbus/issues/31 is implemented.

Co-authored-by: James Mills <prologic@shortcircuit.net.au>
Reviewed-on: https://git.mills.io/saltyim/saltyim/pulls/134
2022-04-03 01:21:35 +00:00
xuu 35c4ecca6f feat: sbscribe to outbox (#128)
Co-authored-by: Jon Lundy <jon@xuu.cc>
Co-authored-by: xuu <me@sour.is>
Reviewed-on: https://git.mills.io/saltyim/saltyim/pulls/128
Reviewed-by: James Mills <james@mills.io>
Co-authored-by: xuu <xuu@noreply@mills.io>
Co-committed-by: xuu <xuu@noreply@mills.io>
2022-04-02 22:32:12 +00:00
James Mills 01b1408e62 Code cleanup (#127)
Co-authored-by: James Mills <prologic@shortcircuit.net.au>
Reviewed-on: https://git.mills.io/saltyim/saltyim/pulls/127
2022-04-02 16:26:33 +00:00
James Mills 8a7fb8686c Fix inbox indexing (#125)
Co-authored-by: James Mills <prologic@shortcircuit.net.au>
Reviewed-on: https://git.mills.io/saltyim/saltyim/pulls/125
2022-04-02 15:58:20 +00:00
James Mills 6a92c9d30a Add support for indexing and persisting inbox index state (#121)
TODO:

- [ ] Remove `replace` directive after testing...

Co-authored-by: James Mills <prologic@shortcircuit.net.au>
Reviewed-on: https://git.mills.io/saltyim/saltyim/pulls/121
2022-04-02 14:15:46 +00:00
James Mills 3fccb3ae5f Add Avatar service and cli for updating avatar on a broker (#116)
This PR also:

- Tidies up the default options and config
- Tidies up the service user code

Co-authored-by: James Mills <prologic@shortcircuit.net.au>
Reviewed-on: https://git.mills.io/saltyim/saltyim/pulls/116
2022-04-02 02:59:39 +00:00
xuu 9da59f133d feat: set outbox nick@domain to destination (#113)
Co-authored-by: Jon Lundy <jon@xuu.cc>
Reviewed-on: https://git.mills.io/saltyim/saltyim/pulls/113
Reviewed-by: James Mills <james@mills.io>
2022-03-31 23:06:33 +00:00
James Mills 4544b1c4cf Remove the use of beeep that causes the PWA on iPhone to crash on startup (#112)
beeep was cuasing the PWA to crash on iPhone with:

```
[Error] Did not parse stylesheet at 'https://salty.mills.io/web/css/micons.woff2' because non CSS MIME types are not allowed in strict mode.
[Log] registering app service worker (app.js, line 12)
[Error] Failed to load resource: the server responded with a status of 404 () (material-components-web.min.css.map, line 0)
[Log] 2022/04/01 08:13:09 connect() (wasm_exec.js, line 22)
[Log] 2022/04/01 08:13:09 creating new client (wasm_exec.js, line 22)
[Log] time="2022-04-01T08:13:09+10:00" level=debug msg="Looking up SRV record for _salty._tcp.mills.io" (wasm_exec.js, line 22)
[Log] time="2022-04-01T08:13:09+10:00" level=debug msg="Using DNSOverHTTPResolver, looking up SRV _salty._tcp.mills.io" (wasm_exec.js, line 22)
[Log] time="2022-04-01T08:13:09+10:00" level=debug msg="Discovered salty services salty.mills.io" (wasm_exec.js, line 22)
[Log] time="2022-04-01T08:13:09+10:00" level=debug msg="map[Accept-Encoding:[br, gzip, deflate] Accept-Ranges:[bytes] Access-Control-Allow-Headers:[*] Access-Control-Allow-Origin:[*] Access-Control-Expose-Headers:[*] Content-Length:[151] Content-Type:[application/json] Date:[Thu, 31 Mar 2022 22:10:02 GMT] Last-Modified:[Mon, 21 Mar 2022 23:59:42 GMT] Vary:[Accept-Encoding, Cookie] X-Salty-Accept-Encoding:[br, gzip, deflate]]" (wasm_exec.js, line 22)
[Log] time="2022-04-01T08:13:09+10:00" level=debug msg="Discovered endpoint: https://salty.mills.io/inbox/01FYQEP8FS9XBDYZV9ZNRY4ENS" (wasm_exec.js, line 22)
[Log] time="2022-04-01T08:13:09+10:00" level=debug msg="Discovered capability: accept-encoding: br, gzip, deflate" (wasm_exec.js, line 22)
[Log] time="2022-04-01T08:13:09+10:00" level=debug msg="Using identity []byte with public key kex1ekt5cru4vs42wnaxppkjn5pexmt2w6uxx9z2mz0fqeuc80e0g9gsggs8ah" (wasm_exec.js, line 22)
[Log] time="2022-04-01T08:13:09+10:00" level=debug msg="Salty Addr is prologic@mills.io" (wasm_exec.js, line 22)
[Log] time="2022-04-01T08:13:09+10:00" level=debug msg="Endpoint is https://salty.mills.io/inbox/01FYQEP8FS9XBDYZV9ZNRY4ENS" (wasm_exec.js, line 22)
[Log] time="2022-04-01T08:13:09+10:00" level=debug msg="Looking up SRV record for _salty._tcp.mills.io" (wasm_exec.js, line 22)
[Log] time="2022-04-01T08:13:09+10:00" level=debug msg="Using DNSOverHTTPResolver, looking up SRV _salty._tcp.mills.io" (wasm_exec.js, line 22)
[Log] time="2022-04-01T08:13:09+10:00" level=debug msg="Connected to https://salty.mills.io/inbox/01FYQEP8FS9XBDYZV9ZNRY4ENS" (wasm_exec.js, line 22)
[Log] fatal error: panic while printing panic value (wasm_exec.js, line 22)
[Log]  (wasm_exec.js, line 22)
[Log] goroutine 17 [running]: (wasm_exec.js, line 22)
[Log] runtime.throw({0x19ad82, 0x20}) (wasm_exec.js, line 22)
[Log] 	/usr/local/go/src/runtime/panic.go:992 +0x7 fp=0x1079620 sp=0x10795f8 pc=0x12600007 (wasm_exec.js, line 22)
[Log] runtime.preprintpanics.func1() (wasm_exec.js, line 22)
[Log] 	/usr/local/go/src/runtime/panic.go:529 +0x5 fp=0x1079640 sp=0x1079620 pc=0x12550005 (wasm_exec.js, line 22)
[Log] runtime.deferCallSave(0x1079718, 0x1db388) (wasm_exec.js, line 22)
[Log] 	/usr/local/go/src/runtime/panic.go:750 +0xe fp=0x1079658 sp=0x1079640 pc=0x125c000e (wasm_exec.js, line 22)
[Log] runtime.runOpenDeferFrame(0x12a0ea0, 0x103fb30) (wasm_exec.js, line 22)
[Log] 	/usr/local/go/src/runtime/panic.go:723 +0x33 fp=0x10796a0 sp=0x1079658 pc=0x125b0033 (wasm_exec.js, line 22)
[Log] panic({0xcc2e0, 0x12bb800}) (wasm_exec.js, line 22)
[Log] 	/usr/local/go/src/runtime/panic.go:838 +0x29 fp=0x1079758 sp=0x10796a0 pc=0x125d0029 (wasm_exec.js, line 22)
[Log] runtime.panicwrap() (wasm_exec.js, line 22)
[Log] 	/usr/local/go/src/runtime/error.go:328 +0x1c fp=0x1079890 sp=0x1079758 pc=0x1090001c (wasm_exec.js, line 22)
[Log] syscall/js.(*Error).Error(0x0) (wasm_exec.js, line 22)
[Log] 	<autogenerated>:1 +0x5 fp=0x10798b8 sp=0x1079890 pc=0x178d0005 (wasm_exec.js, line 22)
[Log] runtime.preprintpanics(0x1079988) (wasm_exec.js, line 22)
[Log] 	/usr/local/go/src/runtime/panic.go:535 +0xa fp=0x1079910 sp=0x10798b8 pc=0x1256000a (wasm_exec.js, line 22)
[Log] panic({0x15d200, 0x0}) (wasm_exec.js, line 22)
[Log] 	/usr/local/go/src/runtime/panic.go:939 +0x53 fp=0x10799c8 sp=0x1079910 pc=0x125d0053 (wasm_exec.js, line 22)
[Log] github.com/gen2brain/beeep.Notify.func1() (wasm_exec.js, line 22)
[Log] 	/home/mattman/go/pkg/mod/github.com/prologic/beeep@v0.0.0-20220331052839-35525ae5ee34/notify_js.go:25 +0xb fp=0x10799f0 sp=0x10799c8 pc=0x42c5000b (wasm_exec.js, line 22)
[Log] runtime.deferCallSave(0x1079ac8, 0x1079c10) (wasm_exec.js, line 22)
[Log] 	/usr/local/go/src/runtime/panic.go:750 +0xe fp=0x1079a08 sp=0x10799f0 pc=0x125c000e (wasm_exec.js, line 22)
[Log] runtime.runOpenDeferFrame(0x12a0ea0, 0x103fae0) (wasm_exec.js, line 22)
[Log] 	/usr/local/go/src/runtime/panic.go:723 +0x33 fp=0x1079a50 sp=0x1079a08 pc=0x125b0033 (wasm_exec.js, line 22)
[Log] panic({0xbc2a0, 0x1294ca8}) (wasm_exec.js, line 22)
[Log] 	/usr/local/go/src/runtime/panic.go:838 +0x29 fp=0x1079b08 sp=0x1079a50 pc=0x125d0029 (wasm_exec.js, line 22)
[Log] syscall/js.Value.Get({{}, 0x0, 0x0}, {0x18d181, 0xa}) (wasm_exec.js, line 22)
[Log] 	/usr/local/go/src/syscall/js/js.go:288 +0xc fp=0x1079b48 sp=0x1079b08 pc=0x174e000c (wasm_exec.js, line 22)
[Log] github.com/gen2brain/beeep.Notify({0x18bd62, 0x8}, {0x1976d0, 0x1c}, {0x0, 0x0}) (wasm_exec.js, line 22)
[Log] 	/home/mattman/go/pkg/mod/github.com/prologic/beeep@v0.0.0-20220331052839-35525ae5ee34/notify_js.go:35 +0x8 fp=0x1079c78 sp=0x1079b48 pc=0x42c30008 (wasm_exec.js, line 22)
[Log] github.com/gen2brain/beeep.Alert({0x18bd62, 0x8}, {0x1976d0, 0x1c}, {0x0, 0x0}) (wasm_exec.js, line 22)
[Log] 	/home/mattman/go/pkg/mod/github.com/prologic/beeep@v0.0.0-20220331052839-35525ae5ee34/alert_js.go:8 +0x2 fp=0x1079cc0 sp=0x1079c78 pc=0x42bf0002 (wasm_exec.js, line 22)
[Log] go.mills.io/saltyim.(*Client).processMessage(0x1296940, 0x1297640, {0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}) (wasm_exec.js, line 22)
[Log] 	/home/mattman/golang/saltyim/client.go:147 +0x2 fp=0x1079e30 sp=0x1079cc0 pc=0x4f610002 (wasm_exec.js, line 22)
[Log] go.mills.io/saltyim.(*Client).Read(0x1296940, {0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}) (wasm_exec.js, line 22)
[Log] 	/home/mattman/golang/saltyim/client.go:314 +0x17 fp=0x1079ec0 sp=0x1079e30 pc=0x4f6a0017 (wasm_exec.js, line 22)
[Log] go.mills.io/saltyim.(*Client).Drain.func1() (wasm_exec.js, line 22)
[Log] 	/home/mattman/golang/saltyim/client.go:261 +0x5 fp=0x1079fe0 sp=0x1079ec0 pc=0x4f690005 (wasm_exec.js, line 22)
[Log] runtime.goexit() (wasm_exec.js, line 22)
[Log] 	/usr/local/go/src/runtime/asm_wasm.s:401 +0x1 fp=0x1079fe8 sp=0x1079fe0 pc=0x14480001 (wasm_exec.js, line 22)
[Log] created by go.mills.io/saltyim.(*Client).Drain (wasm_exec.js, line 22)
[Log] 	/home/mattman/golang/saltyim/client.go:259 +0x15 (wasm_exec.js, line 22)
[Log]  (wasm_exec.js, line 22)
[Log] goroutine 1 [chan receive]: (wasm_exec.js, line 22)
[Log] github.com/likexian/doh-go.(*DoH).fastECSQuery(0x103f9f0, {0x288ed0, 0x12af080}, {0x128dc80, 0x2, 0x2}, {0x107ccf0, 0x14}, {0x189fb6, 0x3}, ...) (wasm_exec.js, line 22)
[Log] 	/home/mattman/go/pkg/mod/github.com/likexian/doh-go@v0.6.4/doh.go:225 +0x1a (wasm_exec.js, line 22)
[Log] github.com/likexian/doh-go.(*DoH).ECSQuery(0x103f9f0, {0x288ed0, 0x12af080}, {0x107ccf0, 0x14}, {0x189fb6, 0x3}, {0x0, 0x0}) (wasm_exec.js, line 22)
[Log] 	/home/mattman/go/pkg/mod/github.com/likexian/doh-go@v0.6.4/doh.go:181 +0xc (wasm_exec.js, line 22)
[Log] github.com/likexian/doh-go.(*DoH).Query(...) (wasm_exec.js, line 22)
[Log] 	/home/mattman/go/pkg/mod/github.com/likexian/doh-go@v0.6.4/doh.go:158 (wasm_exec.js, line 22)
[Log] go.mills.io/saltyim.(*DNSOverHTTPResolver).LookupSRV(0xc09878, {0x18a96c, 0x5}, {0x18a0e5, 0x3}, {0x107cc51, 0x8}) (wasm_exec.js, line 22)
[Log] 	/home/mattman/golang/saltyim/resolv.go:62 +0x13 (wasm_exec.js, line 22)
[Log] go.mills.io/saltyim.(*Addr).Refresh(0x12aec00) (wasm_exec.js, line 22)
[Log] 	/home/mattman/golang/saltyim/lookup.go:179 +0xd (wasm_exec.js, line 22)
[Log] go.mills.io/saltyim.LookupAddr({0x107cc48, 0x11}) (wasm_exec.js, line 22)
[Log] 	/home/mattman/golang/saltyim/lookup.go:246 +0x4 (wasm_exec.js, line 22)
[Log] go.mills.io/saltyim.(*ProxyLookup).LookupAddr(0x12a3360, {0x107cc48, 0x11}) (wasm_exec.js, line 22)
[Log] 	/home/mattman/golang/saltyim/lookup.go:271 +0x3 (wasm_exec.js, line 22)
[Log] go.mills.io/saltyim.(*Client).getAddr(0x1296940, {0x107cc48, 0x11}) (wasm_exec.js, line 22)
[Log] 	/home/mattman/golang/saltyim/client.go:124 +0x8 (wasm_exec.js, line 22)
[Log] go.mills.io/saltyim.(*Client).Lookup(...) (wasm_exec.js, line 22)
[Log] 	/home/mattman/golang/saltyim/client.go:345 (wasm_exec.js, line 22)
[Log] go.mills.io/saltyim/internal/pwa/components.(*ChatMessage).Render(0x10b4c00) (wasm_exec.js, line 22)
[Log] 	/home/mattman/golang/saltyim/internal/pwa/components/chatmessage.go:27 +0x13 (wasm_exec.js, line 22)
[Log] github.com/maxence-charriere/go-app/v9/pkg/app.(*Compo).render(0x10b4c00) (wasm_exec.js, line 22)
[Log] 	/home/mattman/go/pkg/mod/github.com/maxence-charriere/go-app/v9@v9.4.1/pkg/app/component.go:442 +0x6 (wasm_exec.js, line 22)
[Log] github.com/maxence-charriere/go-app/v9/pkg/app.(*Compo).mount(0x10b4c00, {0x28cd38, 0x107fc20}) (wasm_exec.js, line 22)
[Log] 	/home/mattman/go/pkg/mod/github.com/maxence-charriere/go-app/v9@v9.4.1/pkg/app/component.go:293 +0x22 (wasm_exec.js, line 22)
[Log] github.com/maxence-charriere/go-app/v9/pkg/app.mount({0x28cd38, 0x107fc20}, {0x28e000, 0x10b4c00}) (wasm_exec.js, line 22)
[Log] 	/home/mattman/go/pkg/mod/github.com/maxence-charriere/go-app/v9@v9.4.1/pkg/app/node.go:188 +0x5 (wasm_exec.js, line 22)
[Log] github.com/maxence-charriere/go-app/v9/pkg/app.(*elem).replaceChildAt(0x128f220, 0x0, {0x28e000, 0x10b4c00}) (wasm_exec.js, line 22)
[Log] 	/home/mattman/go/pkg/mod/github.com/maxence-charriere/go-app/v9@v9.4.1/pkg/app/element.go:238 +0x8 (wasm_exec.js, line 22)
[Log] github.com/maxence-charriere/go-app/v9/pkg/app.(*elem).update(0x128f220, {0x28d300, 0x12bda40}) (wasm_exec.js, line 22)
[Log] 	/home/mattman/go/pkg/mod/github.com/maxence-charriere/go-app/v9@v9.4.1/pkg/app/element.go:172 +0x3f (wasm_exec.js, line 22)
[Log] github.com/maxence-charriere/go-app/v9/pkg/app.update({0x28d300, 0x128f220}, {0x28d300, 0x12bda40}) (wasm_exec.js, line 22)
[Log] 	/home/mattman/go/pkg/mod/github.com/maxence-charriere/go-app/v9@v9.4.1/pkg/app/node.go:199 +0x8 (wasm_exec.js, line 22)
[Log] github.com/maxence-charriere/go-app/v9/pkg/app.(*Compo).updateRoot(0x10b4880) (wasm_exec.js, line 22)
[Log] 	/home/mattman/go/pkg/mod/github.com/maxence-charriere/go-app/v9@v9.4.1/pkg/app/component.go:386 +0x5 (wasm_exec.js, line 22)
[Log] github.com/maxence-charriere/go-app/v9/pkg/app.(*engine).updateComponents(0x107fc20) (wasm_exec.js, line 22)
[Log] 	/home/mattman/go/pkg/mod/github.com/maxence-charriere/go-app/v9@v9.4.1/pkg/app/engine.go:419 +0x18 (wasm_exec.js, line 22)
[Log] github.com/maxence-charriere/go-app/v9/pkg/app.(*engine).start.func1() (wasm_exec.js, line 22)
[Log] 	/home/mattman/go/pkg/mod/github.com/maxence-charriere/go-app/v9@v9.4.1/pkg/app/engine.go:347 +0x1c (wasm_exec.js, line 22)
[Log] sync.(*Once).doSlow(0x107fc8c, 0x1271d18) (wasm_exec.js, line 22)
[Log] 	/usr/local/go/src/sync/once.go:68 +0x9 (wasm_exec.js, line 22)
[Log] sync.(*Once).Do(0x107fc8c, 0x1271d18) (wasm_exec.js, line 22)
[Log] 	/usr/local/go/src/sync/once.go:59 +0x6 (wasm_exec.js, line 22)
[Log] github.com/maxence-charriere/go-app/v9/pkg/app.(*engine).start(0x107fc20, {0x288e98, 0x101e040}) (wasm_exec.js, line 22)
[Log] 	/home/mattman/go/pkg/mod/github.com/maxence-charriere/go-app/v9@v9.4.1/pkg/app/engine.go:323 +0x4 (wasm_exec.js, line 22)
[Log] github.com/maxence-charriere/go-app/v9/pkg/app.RunWhenOnBrowser() (wasm_exec.js, line 22)
[Log] 	/home/mattman/go/pkg/mod/github.com/maxence-charriere/go-app/v9@v9.4.1/pkg/app/app.go:152 +0x86 (wasm_exec.js, line 22)
[Log] main.main() (wasm_exec.js, line 22)
[Log] 	/home/mattman/golang/saltyim/internal/pwa/main.go:18 +0x2 (wasm_exec.js, line 22)
[Log]  (wasm_exec.js, line 22)
[Log] goroutine 9 [select]: (wasm_exec.js, line 22)
[Log] github.com/likexian/gokit/xcache/memory.(*Objects).gc(0x1260b80) (wasm_exec.js, line 22)
[Log] 	/home/mattman/go/pkg/mod/github.com/likexian/gokit@v0.25.6/xcache/memory/memory.go:244 +0xc (wasm_exec.js, line 22)
[Log] created by github.com/likexian/gokit/xcache/memory.New (wasm_exec.js, line 22)
[Log] 	/home/mattman/go/pkg/mod/github.com/likexian/gokit@v0.25.6/xcache/memory/memory.go:76 +0x12 (wasm_exec.js, line 22)
[Log]  (wasm_exec.js, line 22)
[Log] goroutine 15 [chan receive]: (wasm_exec.js, line 22)
[Log] go.mills.io/saltyim/internal/pwa/components.(*SaltyChat).connect.func1() (wasm_exec.js, line 22)
[Log] 	/home/mattman/golang/saltyim/internal/pwa/components/saltychat.go:116 +0xd (wasm_exec.js, line 22)
[Log] github.com/maxence-charriere/go-app/v9/pkg/app.(*engine).Async.func1() (wasm_exec.js, line 22)
[Log] 	/home/mattman/go/pkg/mod/github.com/maxence-charriere/go-app/v9@v9.4.1/pkg/app/engine.go:124 +0x4 (wasm_exec.js, line 22)
[Log] created by github.com/maxence-charriere/go-app/v9/pkg/app.(*engine).Async (wasm_exec.js, line 22)
[Log] 	/home/mattman/go/pkg/mod/github.com/maxence-charriere/go-app/v9@v9.4.1/pkg/app/engine.go:123 +0xb (wasm_exec.js, line 22)
[Log]  (wasm_exec.js, line 22)
[Log] goroutine 20 [select]: (wasm_exec.js, line 22)
[Log] github.com/likexian/doh-go.Use.func1() (wasm_exec.js, line 22)
[Log] 	/home/mattman/go/pkg/mod/github.com/likexian/doh-go@v0.6.4/doh.go:122 +0xa (wasm_exec.js, line 22)
[Log] created by github.com/likexian/doh-go.Use (wasm_exec.js, line 22)
[Log] 	/home/mattman/go/pkg/mod/github.com/likexian/doh-go@v0.6.4/doh.go:119 +0x14 (wasm_exec.js, line 22)
[Log]  (wasm_exec.js, line 22)
[Log] goroutine 14 [waiting]: (wasm_exec.js, line 22)
[Log] runtime.gopark(0x0, 0x0, 0x0, 0x0, 0x1) (wasm_exec.js, line 22)
[Log] 	/usr/local/go/src/runtime/proc.go:361 +0x27 (wasm_exec.js, line 22)
[Log] runtime.handleEvent() (wasm_exec.js, line 22)
[Log] 	/usr/local/go/src/runtime/lock_js.go:249 +0x1b (wasm_exec.js, line 22)
[Log] runtime.goexit() (wasm_exec.js, line 22)
[Log] 	/usr/local/go/src/runtime/asm_wasm.s:401 +0x1 (wasm_exec.js, line 22)
[Log]  (wasm_exec.js, line 22)
[Log] goroutine 18 [select]: (wasm_exec.js, line 22)
[Log] go.mills.io/saltyim.(*Client).Drain.func2() (wasm_exec.js, line 22)
[Log] 	/home/mattman/golang/saltyim/client.go:284 +0x9 (wasm_exec.js, line 22)
[Log] created by go.mills.io/saltyim.(*Client).Drain (wasm_exec.js, line 22)
[Log] 	/home/mattman/golang/saltyim/client.go:281 +0x2c (wasm_exec.js, line 22)
[Log]  (wasm_exec.js, line 22)
[Log] goroutine 19 [select]: (wasm_exec.js, line 22)
[Log] nhooyr.io/websocket.dial({0x288e98, 0x101e040}, {0x1085740, 0x35}, 0x0) (wasm_exec.js, line 22)
[Log] 	/home/mattman/go/pkg/mod/nhooyr.io/websocket@v1.8.7/ws_js.go:278 +0x1e (wasm_exec.js, line 22)
[Log] nhooyr.io/websocket.Dial({0x288e98, 0x101e040}, {0x1085740, 0x35}, 0x0) (wasm_exec.js, line 22)
[Log] 	/home/mattman/go/pkg/mod/nhooyr.io/websocket@v1.8.7/ws_js.go:247 +0x2 (wasm_exec.js, line 22)
[Log] git.mills.io/prologic/msgbus/client.(*Subscriber).connect(0x12aed80) (wasm_exec.js, line 22)
[Log] 	/home/mattman/go/pkg/mod/git.mills.io/prologic/msgbus@v0.1.13-0.20220329220338-7181b6df1bd6/client/client.go:212 +0x12 (wasm_exec.js, line 22)
[Log] created by git.mills.io/prologic/msgbus/client.(*Subscriber).Start (wasm_exec.js, line 22)
[Log] 	/home/mattman/go/pkg/mod/git.mills.io/prologic/msgbus@v0.1.13-0.20220329220338-7181b6df1bd6/client/client.go:247 +0x7 (wasm_exec.js, line 22)
[Log]  (wasm_exec.js, line 22)
[Log] goroutine 21 [select]: (wasm_exec.js, line 22)
[Log] net/http.(*Transport).RoundTrip(0x1282dc0, 0x10b0d00) (wasm_exec.js, line 22)
[Log] 	/usr/local/go/src/net/http/roundtrip_js.go:193 +0x8e (wasm_exec.js, line 22)
[Log] net/http.send(0x10b0d00, {0x2857b8, 0x1282dc0}, {0x0, 0x0, 0x0}) (wasm_exec.js, line 22)
[Log] 	/usr/local/go/src/net/http/client.go:252 +0x88 (wasm_exec.js, line 22)
[Log] net/http.(*Client).send(0x12c0ba0, 0x10b0d00, {0x0, 0x0, 0x0}) (wasm_exec.js, line 22)
[Log] 	/usr/local/go/src/net/http/client.go:176 +0x11 (wasm_exec.js, line 22)
[Log] net/http.(*Client).do(0x12c0ba0, 0x10b0d00) (wasm_exec.js, line 22)
[Log] 	/usr/local/go/src/net/http/client.go:725 +0xc5 (wasm_exec.js, line 22)
[Log] net/http.(*Client).Do(...) (wasm_exec.js, line 22)
[Log] 	/usr/local/go/src/net/http/client.go:593 (wasm_exec.js, line 22)
[Log] github.com/likexian/gokit/xhttp.(*Request).Do(0x10b4e00, {0x288e60, 0x12975c0}, {0x189f62, 0x3}, {0x19dac6, 0x24}, {0x1047eb0, 0x2, 0x2}) (wasm_exec.js, line 22)
[Log] 	/home/mattman/go/pkg/mod/github.com/likexian/gokit@v0.25.6/xhttp/xhttp.go:685 +0x1d5 (wasm_exec.js, line 22)
[Log] github.com/likexian/gokit/xhttp.(*Request).Get(...) (wasm_exec.js, line 22)
[Log] 	/home/mattman/go/pkg/mod/github.com/likexian/gokit@v0.25.6/xhttp/xhttp.go:285 (wasm_exec.js, line 22)
[Log] github.com/likexian/doh-go/provider/cloudflare.(*Provider).ECSQuery(0x12ad728, {0x288e60, 0x12975c0}, {0x107ccf0, 0x14}, {0x189fb6, 0x3}, {0x0, 0x0}) (wasm_exec.js, line 22)
[Log] 	/home/mattman/go/pkg/mod/github.com/likexian/doh-go@v0.6.4/provider/cloudflare/cloudflare.go:110 +0x30 (wasm_exec.js, line 22)
[Log] github.com/likexian/doh-go.(*DoH).fastECSQuery.func1(0x0, {0x2881f8, 0x12ad728}) (wasm_exec.js, line 22)
[Log] 	/home/mattman/go/pkg/mod/github.com/likexian/doh-go@v0.6.4/doh.go:201 +0x4 (wasm_exec.js, line 22)
[Log] created by github.com/likexian/doh-go.(*DoH).fastECSQuery (wasm_exec.js, line 22)
[Log] 	/home/mattman/go/pkg/mod/github.com/likexian/doh-go@v0.6.4/doh.go:200 +0x5e (wasm_exec.js, line 22)
[Log]  (wasm_exec.js, line 22)
[Log] goroutine 23 [chan receive (nil chan)]: (wasm_exec.js, line 22)
[Log] go.mills.io/saltyim.(*Client).Subscribe.func1() (wasm_exec.js, line 22)
[Log] 	/home/mattman/golang/saltyim/client.go:333 +0x5 (wasm_exec.js, line 22)
[Log] created by go.mills.io/saltyim.(*Client).Subscribe (wasm_exec.js, line 22)
[Log] 	/home/mattman/golang/saltyim/client.go:332 +0x26 (wasm_exec.js, line 22)
[Warning] exit code: – 2 (wasm_exec.js, line 101)
[Error] Error: Go program has already exited
	_resume (wasm_exec.js:536)
	(anonymous function) (wasm_exec.js:549)
[Error] Unhandled Promise Rejection: Error: Go program has already exited
	_resume (wasm_exec.js:536)
	(anonymous function) (wasm_exec.js:549)
	promiseReactionJob
```

Which I have no fucking clue what's going on there :/

Co-authored-by: James Mills <prologic@shortcircuit.net.au>
Reviewed-on: https://git.mills.io/saltyim/saltyim/pulls/112
Reviewed-by: xuu <xuu@noreply@mills.io>
Co-authored-by: James Mills <james@mills.io>
Co-committed-by: James Mills <james@mills.io>
2022-03-31 23:06:08 +00:00
James Mills 764180a658 Fix Send() and ProxySend() (#105)
Co-authored-by: James Mills <prologic@shortcircuit.net.au>
Reviewed-on: https://git.mills.io/saltyim/saltyim/pulls/105
Reviewed-by: xuu <xuu@noreply@mills.io>
2022-03-31 10:40:40 +00:00
James Mills 47f0df7cdc Add support for Dekstop/Web notifications via a forked beeep library (#103)
Co-authored-by: James Mills <prologic@shortcircuit.net.au>
Reviewed-on: https://git.mills.io/saltyim/saltyim/pulls/103
Reviewed-by: xuu <xuu@noreply@mills.io>
2022-03-31 06:33:59 +00:00
James Mills 95be492208 Add support for sender interfaces and the pwa to fallback to sending via a broker as fallback (#101)
Co-authored-by: James Mills <prologic@shortcircuit.net.au>
Reviewed-on: https://git.mills.io/saltyim/saltyim/pulls/101
Reviewed-by: xuu <xuu@noreply@mills.io>
2022-03-31 03:46:12 +00:00
James Mills 57a6ff5ec1 Add support for performing lookups via the broker we were served from (#99)
Depends on #95

Co-authored-by: James Mills <prologic@shortcircuit.net.au>
Reviewed-on: https://git.mills.io/saltyim/saltyim/pulls/99
2022-03-31 00:51:38 +00:00
xuu d9eddfdad1 feat: send to outbox (#98)
closes: #67
Co-authored-by: Jon Lundy <jon@xuu.cc>
Reviewed-on: https://git.mills.io/saltyim/saltyim/pulls/98
Co-authored-by: xuu <xuu@noreply@mills.io>
Co-committed-by: xuu <xuu@noreply@mills.io>
2022-03-31 00:45:25 +00:00
xuu 754fcc7323 feat: add compression negotiation for sent messages (#91)
feat: add compression negotiation for sent messages
fix: unix homedir handling

the service will negotiate a compression algo for sending messages
when a user chats someone during the auto discovery, the service returns an `Accept-Encoding: br, gzip, deflate`

the client saves that response and so when it makes POSTs of messages adds the best `Content-Encoding` and compresses the message

example:
```
>> GET /.well-known/salty/c765c69040d98f3af2181237f47ec01398d80f8ab2690fe929e4311ab05dec01.json

<< Accept-Encoding: br, gzip, deflate
<<
<< {"endpoint":"https://salty.home.arpa/inbox/01FZBR8Y2E6TH949JA3925WF71","key":"kex1wurry09ftqjuxgjl0jxmqypv4axqvzqljkgeadxjcpwtfuhcedcslck52d"}

>> POST /inbox/01FZBR8Y2E6TH949JA3925WF71
>> Content-Encoding: br
>>
>> [Brotli Compressed data]
```

this PR depends on https://git.mills.io/prologic/msgbus/pulls/24

Co-authored-by: Jon Lundy <jon@xuu.cc>
Reviewed-on: https://git.mills.io/saltyim/saltyim/pulls/91
Co-authored-by: xuu <xuu@noreply@mills.io>
Co-committed-by: xuu <xuu@noreply@mills.io>
2022-03-29 22:23:16 +00:00
James Mills f9fa628e75 Add support for new contacts appearing in contact list automatically (#89)
Co-authored-by: James Mills <prologic@shortcircuit.net.au>
Co-authored-by: mlctrez <mlctrez@gmail.com>
Reviewed-on: https://git.mills.io/saltyim/saltyim/pulls/89
2022-03-29 22:06:06 +00:00
James Mills 7fc5e7184b Fix a panic when there is no valid Endpoint (#90)
Fixes #83

But I'm not sure how to properly surface teh aerrors out of the `Subscribe` and `Rain` channels at this time 😆 (and do something sensible with them at eh UI/UX level).

Co-authored-by: James Mills <prologic@shortcircuit.net.au>
Reviewed-on: https://git.mills.io/saltyim/saltyim/pulls/90
Reviewed-by: xuu <xuu@noreply@mills.io>
Co-authored-by: James Mills <james@mills.io>
Co-committed-by: James Mills <james@mills.io>
2022-03-29 19:02:29 +00:00
James Mills 2bd7ee7b4e go_register_redo (#88)
Co-authored-by: James Mills <prologic@shortcircuit.net.au>
Reviewed-on: https://git.mills.io/saltyim/saltyim/pulls/88
Reviewed-by: xuu <xuu@noreply@mills.io>
2022-03-29 04:42:37 +00:00
James Mills 647dc97ff5
Fix some reliability issues with Client.Drain() that was dropping messages 2022-03-29 12:21:06 +10:00
mlctrez 969a263d06 support for contacts, multiple chat threads, and persistence (#77)
Co-authored-by: James Mills <prologic@shortcircuit.net.au>
Co-authored-by: James Mills <james@mills.io>
Co-authored-by: mlctrez <mlctrez@gmail.com>
Reviewed-on: https://git.mills.io/saltyim/saltyim/pulls/77
Co-authored-by: mlctrez <mlctrez@noreply@mills.io>
Co-committed-by: mlctrez <mlctrez@noreply@mills.io>
2022-03-28 21:49:01 +00:00
James Mills 3a82188a5b Add clean-all target to Makefile 2022-03-28 11:08:19 -06:00
James Mills 5e22d087ee Make the service bot actually work finally (#73)
Co-authored-by: James Mills <prologic@shortcircuit.net.au>
Reviewed-on: https://git.mills.io/saltyim/saltyim/pulls/73
Reviewed-by: xuu <xuu@noreply@mills.io>
2022-03-27 05:25:09 +00:00
Jon Lundy da56689e4d fix: stuff 2022-03-26 14:42:39 -06:00
James Mills 5e067f63cc Code cleanup 2022-03-27 03:00:39 +10:00
James Mills 368577c99e Fix svc user (bot) so it actually starts 2022-03-27 02:59:23 +10:00
James Mills 3f025d1ebb Code cleanup 2022-03-27 01:55:44 +10:00
xuu 38a6d71644 xuu/bot (#64)
Co-authored-by: Jon Lundy <jon@xuu.cc>
Co-authored-by: James Mills <prologic@shortcircuit.net.au>
Reviewed-on: https://git.mills.io/saltyim/saltyim/pulls/64
Co-authored-by: xuu <xuu@noreply@mills.io>
Co-committed-by: xuu <xuu@noreply@mills.io>
2022-03-26 14:43:05 +00:00
James Mills 211f725986 Fix Lookup to actually use SRV records (where available) and refactor (#62)
Co-authored-by: James Mills <prologic@shortcircuit.net.au>
Reviewed-on: https://git.mills.io/saltyim/saltyim/pulls/62
Reviewed-by: xuu <xuu@noreply@mills.io>
2022-03-25 23:49:44 +00:00
mlctrez 05c44be6c0 refactor identity create/read for functional arguments to support PWA (#53)
This PR is for refactoring interaction with CreateIdentity(), GetIdentity(), and NewClient() to allow operations on the identity contents from within a PWA where a filesystem is not present.

It was suggested to use functional arguments so this pull request reflects this.

Co-authored-by: mlctrez <mlctrez@gmail.com>
Reviewed-on: https://git.mills.io/saltyim/saltyim/pulls/53
Co-authored-by: mlctrez <mlctrez@noreply@mills.io>
Co-committed-by: mlctrez <mlctrez@noreply@mills.io>
2022-03-24 20:21:29 +00:00
James Mills 5dccf640f2 Fix PackMessage to ensure every message ends with a UNIX newline (\n) 2022-03-23 23:25:03 +10:00
James Mills 7ffefb042e Refactor Endpoint for automatic endpoint discovery and less configuration (#46)
Co-authored-by: James Mills <prologic@shortcircuit.net.au>
Reviewed-on: https://git.mills.io/prologic/saltyim/pulls/46
2022-03-23 12:39:31 +00:00
James Mills 801d6b93bb Add support for client and server (broker) registration (#43)
Co-authored-by: James Mills <prologic@shortcircuit.net.au>
Reviewed-on: https://git.mills.io/prologic/saltyim/pulls/43
2022-03-22 22:59:09 +00:00
James Mills 9036019c54 Use Debug logging level for logging debug logs 2022-03-22 01:26:40 +10:00
James Mills 8993981e81 Refactor the code (#38)
Co-authored-by: James Mills <prologic@shortcircuit.net.au>
Reviewed-on: https://git.mills.io/prologic/saltyim/pulls/38
2022-03-21 14:46:16 +00:00
James Mills 5c36775dd2 Register tcell encodings (Fixes #23) 2022-03-21 16:14:38 +10:00
xuu 7ccd59efc0 feat: make endpoint uniform. add profiles (#30)
Co-authored-by: Jon Lundy <jon@xuu.cc>
Reviewed-on: https://git.mills.io/prologic/saltyim/pulls/30
Co-authored-by: xuu <xuu@noreply@mills.io>
Co-committed-by: xuu <xuu@noreply@mills.io>
2022-03-21 00:31:59 +00:00
Phil S 1e9101d96d Have text not touch border (#17)
It's the little things...

Co-authored-by: Phil S <ullarah@noreply@mills.io>
Reviewed-on: https://git.mills.io/prologic/saltyim/pulls/17
Co-authored-by: Phil S. <ullarah@noreply@mills.io>
Co-committed-by: Phil S. <ullarah@noreply@mills.io>
2022-03-20 06:13:52 +00:00
James Mills 27fdd5c562 Set width to inner rect of chat box 2022-03-20 15:52:16 +10:00
James Mills b2a648a2bc Further improve the formatting 2022-03-20 15:46:38 +10:00
Phil S 93589b15b0 Chat formatting (#16)
Changed chat format to have the text on a separate line instead of inline with datetime and user.

Co-authored-by: Phil S <ullarah@noreply@mills.io>
Reviewed-on: https://git.mills.io/prologic/saltyim/pulls/16
Co-authored-by: Phil S. <ullarah@noreply@mills.io>
Co-committed-by: Phil S. <ullarah@noreply@mills.io>
2022-03-20 05:08:02 +00:00
James Mills e25622a087 Use some padding for the user 2022-03-20 14:58:55 +10:00
James Mills 50172a32ae Fixed filtering logic in UI 2022-03-20 14:52:04 +10:00