Updating to latest groupme-lib which shares a single websocket for all faye subscriptions for all users
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
8797e96b22
commit
5e71ad974c
8
go.mod
8
go.mod
@ -11,13 +11,11 @@ require (
|
||||
maunium.net/go/mautrix v0.16.1-0.20230821105106-ac5c2c22102c
|
||||
)
|
||||
|
||||
require (
|
||||
gitea.watsonlabs.net/watsonb8/groupme-lib v0.3.0
|
||||
go.mau.fi/util v0.0.0-20230805171708-199bf3eec776
|
||||
)
|
||||
require go.mau.fi/util v0.0.0-20230805171708-199bf3eec776
|
||||
|
||||
require (
|
||||
gitea.watsonlabs.net/watsonb8/fayec v0.0.0-20230919151904-5ca9ade6f946 // indirect
|
||||
gitea.watsonlabs.net/watsonb8/fayec v0.0.3 // indirect
|
||||
gitea.watsonlabs.net/watsonb8/groupme-lib v0.3.3 // indirect
|
||||
github.com/beorn7/perks v1.0.1 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.1.1 // indirect
|
||||
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
|
||||
|
48
go.sum
48
go.sum
@ -1,17 +1,31 @@
|
||||
cloud.google.com/go v0.34.0 h1:eOI3/cP2VTU6uZLDYAoic+eyzzB9YyGmJ7eIjl8rOPg=
|
||||
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
gitea.watsonlabs.net/watsonb8/fayec v0.0.0-20230919020138-8f0db7048755 h1:FEhNSjSNvZ+nVg5Z3ds6X8ys3qjM+mmyLTSqKhCUHuQ=
|
||||
gitea.watsonlabs.net/watsonb8/fayec v0.0.0-20230919020138-8f0db7048755/go.mod h1:gv8CWMq6dFJQhH30u8bO3u4k2irKlclZktLNYDebQ/0=
|
||||
gitea.watsonlabs.net/watsonb8/fayec v0.0.0-20230919151904-5ca9ade6f946 h1:loc70tiaFs1U4sqn+lKMSBlo5OfvVfClYnWjfGLXaSg=
|
||||
gitea.watsonlabs.net/watsonb8/fayec v0.0.0-20230919151904-5ca9ade6f946/go.mod h1:gv8CWMq6dFJQhH30u8bO3u4k2irKlclZktLNYDebQ/0=
|
||||
gitea.watsonlabs.net/watsonb8/fayec v0.0.2 h1:tqbgr1vRZ6Wq4W81xBg+FTOywSv3EJpK263SAVXXTco=
|
||||
gitea.watsonlabs.net/watsonb8/fayec v0.0.2/go.mod h1:gv8CWMq6dFJQhH30u8bO3u4k2irKlclZktLNYDebQ/0=
|
||||
gitea.watsonlabs.net/watsonb8/fayec v0.0.3 h1:YpaZBIee8Ix6uGm1UoEtBix1dEU1TURChAsJGJ3pVRo=
|
||||
gitea.watsonlabs.net/watsonb8/fayec v0.0.3/go.mod h1:gv8CWMq6dFJQhH30u8bO3u4k2irKlclZktLNYDebQ/0=
|
||||
gitea.watsonlabs.net/watsonb8/groupme-lib v0.2.1-0.20230919023741-5727a20506fa h1:dFNaDeztJzo26t7URiOvaWNUDxve80tAAEHTKpi5JEk=
|
||||
gitea.watsonlabs.net/watsonb8/groupme-lib v0.2.1-0.20230919023741-5727a20506fa/go.mod h1:QRCibl6Tpr/uBtXD46qXqEkxqR5tQa5vdw+0j7hn+Mw=
|
||||
gitea.watsonlabs.net/watsonb8/groupme-lib v0.3.0 h1:Uz5TIIF9tFf0LYEbCJqP8axufdBfsVorAYOaal2NmPw=
|
||||
gitea.watsonlabs.net/watsonb8/groupme-lib v0.3.0/go.mod h1:vddDne/D5rrUUQkiIXveB7R3rONGEy4wtAIpGL+yFXA=
|
||||
gitea.watsonlabs.net/watsonb8/groupme-lib v0.3.1 h1:2HE8pyjczDZ74rhUE2fLvubiknR9Aj+izTcCewiTdik=
|
||||
gitea.watsonlabs.net/watsonb8/groupme-lib v0.3.1/go.mod h1:7pn2rsi3Axc15rW24idJfBjuXAFxvjLRmMK/0Ex0dKM=
|
||||
gitea.watsonlabs.net/watsonb8/groupme-lib v0.3.2 h1:QJLwAqYoIxhTtZIzMsjZGiLcml6NCS91DLvnmt/N7bM=
|
||||
gitea.watsonlabs.net/watsonb8/groupme-lib v0.3.2/go.mod h1:htgKMGvk2QieyYT69DWnTLABFc/6ttMlIRIr6zPXNfo=
|
||||
gitea.watsonlabs.net/watsonb8/groupme-lib v0.3.3 h1:sBmF/10Zk0iyKs1nakHfOeB9BUoSyemCpDUEux+BpMk=
|
||||
gitea.watsonlabs.net/watsonb8/groupme-lib v0.3.3/go.mod h1:htgKMGvk2QieyYT69DWnTLABFc/6ttMlIRIr6zPXNfo=
|
||||
github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60=
|
||||
github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
|
||||
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
|
||||
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM=
|
||||
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
|
||||
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
||||
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
||||
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d h1:UQZhZ2O0vMHr2cI+DC1Mbh0TJxzA3RcLoMsFw+aXw7E=
|
||||
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
|
||||
github.com/autogrowsystems/wray v0.0.0-20160519030252-f36984f6648c/go.mod h1:druJ8QMeBCUmwJ7ZSFowx77dWxEWF3SYlQlsqZaLZQg=
|
||||
github.com/beeper/groupme-lib v0.2.0 h1:d/RSHPso6qjG80cH4nFEBeGnoEo7LJfKdvM+nCBLkqk=
|
||||
@ -35,13 +49,19 @@ github.com/gabriel-vasile/mimetype v0.3.23/go.mod h1:6CDPel/o/3/s4+bp6kIbsWATq8p
|
||||
github.com/gabriel-vasile/mimetype v1.1.2 h1:gaPnPcNor5aZSVCJVSGipcpbgMWiAAj9z182ocSGbHU=
|
||||
github.com/gabriel-vasile/mimetype v1.1.2/go.mod h1:6CDPel/o/3/s4+bp6kIbsWATq8pmgOisOPG40CJa6To=
|
||||
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
|
||||
github.com/go-kit/kit v0.9.0 h1:wDJmvq38kDhkVxi50ni9ykkdUr1PKgqKOoi01fa0Mdk=
|
||||
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
|
||||
github.com/go-kit/log v0.1.0 h1:DGJh0Sm43HbOeYDNnVZFl8BvcYVvjD5bqYJvp0REbwQ=
|
||||
github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY=
|
||||
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
|
||||
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
|
||||
github.com/go-logfmt/logfmt v0.5.0 h1:TrB8swr/68K7m9CcGut2g3UOihhbcbiMAYiuTXdEih4=
|
||||
github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
|
||||
github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk=
|
||||
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
|
||||
github.com/godbus/dbus/v5 v5.0.4 h1:9349emZab16e7zQvpmsbtjc18ykshndd8y2PG3sgJbA=
|
||||
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
||||
github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo=
|
||||
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
|
||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
@ -61,6 +81,7 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
|
||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg=
|
||||
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw=
|
||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/google/uuid v1.2.0 h1:qJYtXnJRWmpe7m/3XlyhrsLrEURqHRM2kxzoxXqyUDs=
|
||||
github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
@ -72,21 +93,27 @@ github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=
|
||||
github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
|
||||
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
|
||||
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||
github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA=
|
||||
github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
|
||||
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
|
||||
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
|
||||
github.com/json-iterator/go v1.1.11 h1:uVUAXhF2To8cbw/3xN3pxj6kk7TYKs98NIrTqPlMWAQ=
|
||||
github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
|
||||
github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
|
||||
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
|
||||
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
|
||||
github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U=
|
||||
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
|
||||
github.com/karmanyaahm/wray v0.0.0-20210303233435-756d58657c14 h1:NrATjZKvkY+ojL8FXTWa3fQ+wihFrAxLNE6T+wOkIcY=
|
||||
github.com/karmanyaahm/wray v0.0.0-20210303233435-756d58657c14/go.mod h1:ysD86MIEevmAkdfdg5s6Qt3I07RN6fvMAyna7jCGG2o=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515 h1:T+h1c/A9Gawja4Y9mFVWj2vyii2bbUNDw3kt9VxK2EY=
|
||||
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
|
||||
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pty v1.1.1 h1:VkoXIwSboBpnk99O/KFauAEILuNHv5DVFKZMBN/gUgw=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
@ -101,13 +128,17 @@ github.com/mattn/go-sqlite3 v1.14.17/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
|
||||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||
github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI=
|
||||
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
|
||||
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU=
|
||||
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
|
||||
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
@ -129,11 +160,13 @@ github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsT
|
||||
github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
|
||||
github.com/prometheus/procfs v0.6.0 h1:mxy4L2jP6qMonqmq+aTtOx1ifVWUgG/TAmntgbh3xv4=
|
||||
github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
|
||||
github.com/rs/xid v1.5.0 h1:mKX4bl4iPYJtEIxp6CYiUuLQ/8DYMoz0PUdtGgMFRVc=
|
||||
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
|
||||
github.com/rs/zerolog v1.30.0 h1:SymVODrcRsaRaSInD9yQtKbtWqwsfoPcRff/oRXLj4c=
|
||||
github.com/rs/zerolog v1.30.0/go.mod h1:/tk+P47gFdPXq4QYjvCmT5/Gsug2nagsFWBWhAiSi1w=
|
||||
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
|
||||
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
|
||||
github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I=
|
||||
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
|
||||
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=
|
||||
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
|
||||
@ -141,6 +174,7 @@ github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIK
|
||||
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
|
||||
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
@ -170,6 +204,8 @@ golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk=
|
||||
golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw=
|
||||
golang.org/x/exp v0.0.0-20230810033253-352e893a4cad h1:g0bG7Z4uG+OgH2QDODnjp6ggkk1bJDsINcuWmJN1iJU=
|
||||
golang.org/x/exp v0.0.0-20230810033253-352e893a4cad/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc=
|
||||
golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU=
|
||||
golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
@ -179,10 +215,12 @@ golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLL
|
||||
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||
golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14=
|
||||
golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI=
|
||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421 h1:Wo7BWFiOk0QRFMLYMqJGFMd9CgUAcGx7V+qEg/h5IBI=
|
||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs=
|
||||
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
@ -199,11 +237,19 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBc
|
||||
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM=
|
||||
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/term v0.11.0 h1:F9tnn/DA/Im8nCwm+fX+1/eBwi4qFjRT++MhtVC4ZX0=
|
||||
golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||
golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc=
|
||||
golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.2.0 h1:G6AHpWxTMGY1KyEYoAQ5WTtIekUUvDNjan3ugu60JvE=
|
||||
golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508=
|
||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
||||
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
|
||||
@ -213,6 +259,7 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi
|
||||
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||
google.golang.org/protobuf v1.26.0-rc.1 h1:7QnIQpGRHE5RnLKnESfDoxm2dTapTZua5a0kS0A+VXQ=
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc=
|
||||
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
|
||||
@ -223,6 +270,7 @@ gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
|
||||
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
|
@ -11,35 +11,35 @@ type Client struct {
|
||||
}
|
||||
|
||||
// NewClient creates a new GroupMe API Client
|
||||
func NewClient(authToken string) *Client {
|
||||
func NewClient() *Client {
|
||||
n := Client{
|
||||
Client: groupme.NewClient(authToken),
|
||||
Client: groupme.NewClient(),
|
||||
}
|
||||
return &n
|
||||
}
|
||||
func (c Client) IndexAllGroups() ([]*groupme.Group, error) {
|
||||
func (c Client) IndexAllGroups(authToken string) ([]*groupme.Group, error) {
|
||||
return c.IndexGroups(context.TODO(), &groupme.GroupsQuery{
|
||||
// Omit: "memberships",
|
||||
PerPage: 100, //TODO: Configurable and add multipage support
|
||||
})
|
||||
}, authToken)
|
||||
}
|
||||
|
||||
func (c Client) IndexAllRelations() ([]*groupme.User, error) {
|
||||
return c.IndexRelations(context.TODO())
|
||||
func (c Client) IndexAllRelations(authToken string) ([]*groupme.User, error) {
|
||||
return c.IndexRelations(context.TODO(), authToken)
|
||||
}
|
||||
|
||||
func (c Client) IndexAllChats() ([]*groupme.Chat, error) {
|
||||
func (c Client) IndexAllChats(authToken string) ([]*groupme.Chat, error) {
|
||||
return c.IndexChats(context.TODO(), &groupme.IndexChatsQuery{
|
||||
PerPage: 100, //TODO?
|
||||
})
|
||||
}, authToken)
|
||||
}
|
||||
|
||||
func (c Client) LoadMessagesAfter(groupID groupme.ID, lastMessageID string, lastMessageFromMe bool, private bool) ([]*groupme.Message, error) {
|
||||
func (c Client) LoadMessagesAfter(groupID groupme.ID, lastMessageID string, lastMessageFromMe bool, private bool, authToken string) ([]*groupme.Message, error) {
|
||||
if private {
|
||||
ans, e := c.IndexDirectMessages(context.TODO(), groupID.String(), &groupme.IndexDirectMessagesQuery{
|
||||
SinceID: groupme.ID(lastMessageID),
|
||||
//Limit: num,
|
||||
})
|
||||
}, authToken)
|
||||
//fmt.Println(groupID, lastMessageID, num, i.Count, e)
|
||||
if e != nil {
|
||||
return nil, e
|
||||
@ -54,7 +54,7 @@ func (c Client) LoadMessagesAfter(groupID groupme.ID, lastMessageID string, last
|
||||
AfterID: groupme.ID(lastMessageID),
|
||||
//20 for consistency with dms
|
||||
Limit: 20,
|
||||
})
|
||||
}, authToken)
|
||||
//fmt.Println(groupID, lastMessageID, num, i.Count, e)
|
||||
if e != nil {
|
||||
return nil, e
|
||||
@ -63,12 +63,12 @@ func (c Client) LoadMessagesAfter(groupID groupme.ID, lastMessageID string, last
|
||||
}
|
||||
}
|
||||
|
||||
func (c Client) LoadMessagesBefore(groupID, lastMessageID string, private bool) ([]*groupme.Message, error) {
|
||||
func (c Client) LoadMessagesBefore(groupID, lastMessageID string, private bool, authToken string) ([]*groupme.Message, error) {
|
||||
if private {
|
||||
i, e := c.IndexDirectMessages(context.TODO(), groupID, &groupme.IndexDirectMessagesQuery{
|
||||
BeforeID: groupme.ID(lastMessageID),
|
||||
//Limit: num,
|
||||
})
|
||||
}, authToken)
|
||||
//fmt.Println(groupID, lastMessageID, num, i.Count, e)
|
||||
if e != nil {
|
||||
return nil, e
|
||||
@ -80,7 +80,7 @@ func (c Client) LoadMessagesBefore(groupID, lastMessageID string, private bool)
|
||||
BeforeID: groupme.ID(lastMessageID),
|
||||
//20 for consistency with dms
|
||||
Limit: 20,
|
||||
})
|
||||
}, authToken)
|
||||
//fmt.Println(groupID, lastMessageID, num, i.Count, e)
|
||||
if e != nil {
|
||||
return nil, e
|
||||
@ -89,10 +89,10 @@ func (c Client) LoadMessagesBefore(groupID, lastMessageID string, private bool)
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Client) RemoveFromGroup(uid, groupID groupme.ID) error {
|
||||
group, err := c.ShowGroup(context.TODO(), groupID)
|
||||
func (c *Client) RemoveFromGroup(uid, groupID groupme.ID, authToken string) error {
|
||||
group, err := c.ShowGroup(context.TODO(), groupID, authToken)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return c.RemoveMember(context.TODO(), groupID, group.GetMemberByUserID(uid).ID)
|
||||
return c.RemoveMember(context.TODO(), groupID, group.GetMemberByUserID(uid).ID, authToken)
|
||||
}
|
||||
|
7
main.go
7
main.go
@ -17,9 +17,11 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
_ "embed"
|
||||
"fmt"
|
||||
"gitea.watsonlabs.net/watsonb8/groupme-lib"
|
||||
"github.com/beeper/groupme/groupmeext"
|
||||
"go.mau.fi/util/configupgrade"
|
||||
"maunium.net/go/mautrix/bridge/bridgeconfig"
|
||||
"maunium.net/go/mautrix/event"
|
||||
@ -118,11 +120,14 @@ func (br *GMBridge) Start() {
|
||||
func (br *GMBridge) StartUsers() {
|
||||
br.Log.Debugln("Starting users")
|
||||
foundAnySessions := false
|
||||
gmc := groupmeext.NewClient()
|
||||
conn := groupme.NewPushSubscription(context.Background())
|
||||
conn.Connect(context.Background())
|
||||
for _, user := range br.GetAllUsers() {
|
||||
if user.GMID.Valid() {
|
||||
foundAnySessions = true
|
||||
}
|
||||
go user.Connect()
|
||||
go user.Connect(gmc, &conn)
|
||||
}
|
||||
if !foundAnySessions {
|
||||
br.SendGlobalBridgeState(status.BridgeState{StateEvent: status.StateUnconfigured}.Fill(nil))
|
||||
|
29
portal.go
29
portal.go
@ -143,10 +143,12 @@ func (portal *Portal) SyncDM(user *User, dm *groupme.Chat) {
|
||||
}
|
||||
portal.log.Infoln("Syncing portal for", user.MXID)
|
||||
|
||||
err := user.Conn.SubscribeToDM(context.TODO(), dm.LastMessage.ConversationID)
|
||||
if err != nil {
|
||||
portal.log.Errorln("Subscribing failed, live metadata updates won't work", err)
|
||||
}
|
||||
go func() {
|
||||
err := user.Conn.SubscribeToDM(context.TODO(), dm.LastMessage.ConversationID, user.Token)
|
||||
if err != nil {
|
||||
portal.log.Errorln("Subscribing failed, live metadata updates won't work", err)
|
||||
}
|
||||
}()
|
||||
|
||||
if len(portal.MXID) == 0 {
|
||||
puppet := portal.bridge.GetPuppetByGMID(portal.Key.GMID)
|
||||
@ -204,10 +206,12 @@ func (portal *Portal) SyncGroup(user *User, group *groupme.Group) {
|
||||
}
|
||||
portal.log.Infoln("Syncing portal for", user.MXID)
|
||||
|
||||
err := user.Conn.SubscribeToGroup(context.TODO(), portal.Key.GMID)
|
||||
if err != nil {
|
||||
portal.log.Errorln("Subscribing failed, live metadata updates won't work", err)
|
||||
}
|
||||
go func() {
|
||||
err := user.Conn.SubscribeToGroup(context.TODO(), portal.Key.GMID, user.Token)
|
||||
if err != nil {
|
||||
portal.log.Errorln("Subscribing failed, live metadata updates won't work", err)
|
||||
}
|
||||
}()
|
||||
|
||||
if len(portal.MXID) == 0 {
|
||||
portal.Name = group.Name
|
||||
@ -352,7 +356,8 @@ func (portal *Portal) updateMetadata(user *User) bool {
|
||||
if portal.IsPrivateChat() {
|
||||
return false
|
||||
}
|
||||
group, err := user.Client.ShowGroup(context.TODO(), groupme.ID(strings.Replace(portal.Key.GMID.String(), groupmeext.NewUserSuffix, "", 1)))
|
||||
group, err := user.Client.ShowGroup(context.TODO(), groupme.ID(strings.Replace(portal.Key.GMID.String(),
|
||||
groupmeext.NewUserSuffix, "", 1)), user.Token)
|
||||
if err != nil {
|
||||
portal.log.Errorln(err)
|
||||
return false
|
||||
@ -566,7 +571,7 @@ func (portal *Portal) HandleMatrixLeave(sender *User) {
|
||||
return
|
||||
} else {
|
||||
// TODO should we somehow deduplicate this call if this leave was sent by the bridge?
|
||||
err := sender.Client.RemoveFromGroup(sender.GMID, portal.Key.GMID)
|
||||
err := sender.Client.RemoveFromGroup(sender.GMID, portal.Key.GMID, sender.Token)
|
||||
if err != nil {
|
||||
portal.log.Errorfln("Failed to leave group as %s: %v", sender.MXID, err)
|
||||
return
|
||||
@ -1162,9 +1167,9 @@ func (portal *Portal) sendRaw(sender *User, evt *event.Event, info *groupme.Mess
|
||||
var err error
|
||||
|
||||
if portal.IsPrivateChat() {
|
||||
m, err = sender.Client.CreateDirectMessage(context.TODO(), info)
|
||||
m, err = sender.Client.CreateDirectMessage(context.TODO(), info, sender.Token)
|
||||
} else {
|
||||
m, err = sender.Client.CreateMessage(context.TODO(), info.GroupID, info)
|
||||
m, err = sender.Client.CreateMessage(context.TODO(), info.GroupID, info, sender.Token)
|
||||
}
|
||||
|
||||
id := ""
|
||||
|
76
user.go
76
user.go
@ -120,7 +120,7 @@ func (user *User) GetMXID() id.UserID {
|
||||
|
||||
func (user *User) GetGMID() groupme.ID {
|
||||
if user.GMID == "" {
|
||||
u, err := user.Client.MyUser(context.TODO())
|
||||
u, err := user.Client.MyUser(context.TODO(), user.Token)
|
||||
if err != nil {
|
||||
user.log.Errorln("Failed to get own GroupMe ID:", err)
|
||||
return ""
|
||||
@ -227,7 +227,7 @@ func (user *User) Login(token string) error {
|
||||
user.Update()
|
||||
|
||||
user.addToGMIDMap()
|
||||
if user.Connect() {
|
||||
if user.Connect(user.Client, user.Conn) {
|
||||
user.PostLogin()
|
||||
return nil
|
||||
}
|
||||
@ -244,8 +244,9 @@ func (user *User) PostLogin() {
|
||||
go user.intPostLogin()
|
||||
}
|
||||
|
||||
func (user *User) Connect() bool {
|
||||
func (user *User) Connect(gmClient *groupmeext.Client, pushSub *groupme.PushSubscription) bool {
|
||||
user.SpaceId = "GroupMe"
|
||||
user.Client = gmClient
|
||||
if user.Conn != nil {
|
||||
return true
|
||||
} else if len(user.Token) == 0 {
|
||||
@ -258,12 +259,10 @@ func (user *User) Connect() bool {
|
||||
timeout = 20
|
||||
}
|
||||
|
||||
conn := groupme.NewPushSubscription(context.Background())
|
||||
user.Conn = &conn
|
||||
user.Conn.Connect(context.Background(), user.Token)
|
||||
user.Client = groupmeext.NewClient(user.Token)
|
||||
user.Conn = pushSub
|
||||
|
||||
if user.GMID == "" {
|
||||
myuser, err := user.Client.MyUser(context.TODO())
|
||||
myuser, err := user.Client.MyUser(context.TODO(), user.Token)
|
||||
if err != nil {
|
||||
log.Fatal(err) //TODO
|
||||
}
|
||||
@ -278,15 +277,22 @@ func (user *User) Connect() bool {
|
||||
|
||||
func (user *User) RestoreSession() bool {
|
||||
if len(user.Token) > 0 {
|
||||
err := user.Conn.SubscribeToUser(context.TODO(), user.GMID)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
go func() {
|
||||
err := user.Conn.SubscribeToUser(context.TODO(), user.GMID, user.Token)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
}()
|
||||
//if err != nil {
|
||||
// fmt.Println(err)
|
||||
//}
|
||||
|
||||
//TODO: typing notifics
|
||||
user.ConnectionErrors = 0
|
||||
//user.SetSession(&sess)
|
||||
user.log.Debugln("Session restored successfully")
|
||||
user.PostLogin()
|
||||
|
||||
return true
|
||||
} else {
|
||||
user.log.Debugln("tried login but no token")
|
||||
@ -351,7 +357,11 @@ func (user *User) HandleTextMessage(message groupme.Message) {
|
||||
id := database.ParsePortalKey(message.GroupID.String())
|
||||
|
||||
if id == nil {
|
||||
id = database.ParsePortalKey(message.ConversationID.String())
|
||||
if user.GMID == message.UserID {
|
||||
id = database.ParsePortalKey(message.UserID.String() + "+" + message.RecipientID.String())
|
||||
} else {
|
||||
id = database.ParsePortalKey(message.RecipientID.String() + "+" + message.UserID.String())
|
||||
}
|
||||
}
|
||||
if id == nil {
|
||||
user.log.Errorln("Error parsing conversationid/portalkey", message.ConversationID.String(), "ignoring message")
|
||||
@ -426,7 +436,7 @@ func (user *User) HandleJSONParseError(err error) {
|
||||
|
||||
func (user *User) HandleChatList() {
|
||||
chatMap := map[groupme.ID]*groupme.Group{}
|
||||
chats, err := user.Client.IndexAllGroups()
|
||||
chats, err := user.Client.IndexAllGroups(user.Token)
|
||||
if err != nil {
|
||||
user.log.Errorln("chat sync error", err) //TODO: handle
|
||||
return
|
||||
@ -437,18 +447,18 @@ func (user *User) HandleChatList() {
|
||||
user.GroupList = chatMap
|
||||
|
||||
dmMap := map[groupme.ID]*groupme.Chat{}
|
||||
dms, err := user.Client.IndexAllChats()
|
||||
dms, err := user.Client.IndexAllChats(user.Token)
|
||||
if err != nil {
|
||||
user.log.Errorln("chat sync error", err) //TODO: handle
|
||||
return
|
||||
}
|
||||
for _, dm := range dms {
|
||||
dmMap[dm.OtherUser.ID] = dm
|
||||
dmMap[dm.LastMessage.ConversationID] = dm
|
||||
}
|
||||
user.ChatList = dmMap
|
||||
|
||||
userMap := map[groupme.ID]*groupme.User{}
|
||||
users, err := user.Client.IndexAllRelations()
|
||||
users, err := user.Client.IndexAllRelations(user.Token)
|
||||
if err != nil {
|
||||
user.log.Errorln("Error syncing user list, continuing sync", err)
|
||||
}
|
||||
@ -598,21 +608,21 @@ func (user *User) sendMarkdownBridgeAlert(formatString string, args ...interface
|
||||
}
|
||||
}
|
||||
|
||||
func (user *User) postConnPing() bool {
|
||||
user.log.Debugln("Making post-connection ping")
|
||||
if !user.Conn.Connected() {
|
||||
user.log.Errorfln("Post-connection ping failed: %v. Disconnecting and then reconnecting after a second")
|
||||
user.bridge.Metrics.TrackDisconnection(user.MXID)
|
||||
go func() {
|
||||
time.Sleep(1 * time.Second)
|
||||
user.Connect()
|
||||
}()
|
||||
return false
|
||||
} else {
|
||||
user.log.Debugln("Post-connection ping OK")
|
||||
return true
|
||||
}
|
||||
}
|
||||
//func (user *User) postConnPing() bool {
|
||||
// user.log.Debugln("Making post-connection ping")
|
||||
// if !user.Conn.Connected() {
|
||||
// user.log.Errorfln("Post-connection ping failed: %v. Disconnecting and then reconnecting after a second")
|
||||
// user.bridge.Metrics.TrackDisconnection(user.MXID)
|
||||
// go func() {
|
||||
// time.Sleep(1 * time.Second)
|
||||
// user.Connect()
|
||||
// }()
|
||||
// return false
|
||||
// } else {
|
||||
// user.log.Debugln("Post-connection ping OK")
|
||||
// return true
|
||||
// }
|
||||
//}
|
||||
|
||||
func (user *User) intPostLogin() {
|
||||
defer user.syncWait.Done()
|
||||
@ -629,7 +639,7 @@ func (user *User) intPostLogin() {
|
||||
user.log.Debugln("Chat list receive confirmation received in PostLogin")
|
||||
case <-time.After(time.Duration(10000 /**user.bridge.Config.Bridge.ChatListWait**/) * time.Second):
|
||||
user.log.Warnln("Timed out waiting for chat list to arrive!")
|
||||
user.postConnPing()
|
||||
//user.postConnPing()
|
||||
return
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user