diff --git a/go.mod b/go.mod index c9cbf0c..cdd4fbd 100644 --- a/go.mod +++ b/go.mod @@ -4,9 +4,11 @@ go 1.22 require ( github.com/gabriel-vasile/mimetype v1.4.5 + github.com/google/uuid v1.6.0 github.com/rs/zerolog v1.33.0 - go.mau.fi/mautrix-gmessages/libgm v0.4.3 + github.com/stretchr/testify v1.9.0 go.mau.fi/util v0.6.1-0.20240815104112-77362c9b05dd + golang.org/x/crypto v0.26.0 golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa google.golang.org/protobuf v1.34.2 gopkg.in/yaml.v3 v3.0.1 @@ -15,7 +17,7 @@ require ( require ( github.com/coreos/go-systemd/v22 v22.5.0 // indirect - github.com/google/uuid v1.6.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect github.com/gorilla/mux v1.8.0 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/kr/pretty v0.3.1 // indirect @@ -24,6 +26,7 @@ require ( github.com/mattn/go-isatty v0.0.19 // indirect github.com/mattn/go-sqlite3 v1.14.22 // indirect github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect github.com/rogpeppe/go-internal v1.10.0 // indirect github.com/rs/xid v1.5.0 // indirect github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e // indirect @@ -33,7 +36,6 @@ require ( github.com/tidwall/sjson v1.2.5 // indirect github.com/yuin/goldmark v1.7.4 // indirect go.mau.fi/zeroconfig v0.1.3 // indirect - golang.org/x/crypto v0.26.0 // indirect golang.org/x/net v0.28.0 // indirect golang.org/x/sys v0.24.0 // indirect golang.org/x/text v0.17.0 // indirect @@ -41,7 +43,3 @@ require ( gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect maunium.net/go/mauflag v1.0.0 // indirect ) - -replace go.mau.fi/mautrix-gmessages/libgm => ./libgm - -//replace maunium.net/go/mautrix => ../mautrix-go diff --git a/libgm/gmtest/go.mod b/libgm/gmtest/go.mod deleted file mode 100644 index 9e13b96..0000000 --- a/libgm/gmtest/go.mod +++ /dev/null @@ -1,21 +0,0 @@ -module go.mau.fi/mautrix-gmessages/libgm/gmtest - -go 1.21 - -require ( - github.com/rs/zerolog v1.33.0 - go.mau.fi/mautrix-gmessages/libgm v0.4.3 -) - -require ( - github.com/google/uuid v1.6.0 // indirect - github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.20 // indirect - go.mau.fi/util v0.6.1-0.20240722085753-2d7945696c9b // indirect - golang.org/x/crypto v0.25.0 // indirect - golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect - golang.org/x/sys v0.22.0 // indirect - google.golang.org/protobuf v1.34.2 // indirect -) - -replace go.mau.fi/mautrix-gmessages/libgm => ../ diff --git a/libgm/gmtest/go.sum b/libgm/gmtest/go.sum deleted file mode 100644 index c999aa9..0000000 --- a/libgm/gmtest/go.sum +++ /dev/null @@ -1,37 +0,0 @@ -github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= -github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= -github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= -github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= -github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -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= -github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= -github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -go.mau.fi/util v0.6.1-0.20240722085753-2d7945696c9b h1:8s3uTMPZts03evXLqdTJ0WXB0YWZDNSovpd6oFfCFvY= -go.mau.fi/util v0.6.1-0.20240722085753-2d7945696c9b/go.mod h1:ljYdq3sPfpICc3zMU+/mHV/sa4z0nKxc67hSBwnrk8U= -golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= -golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= -golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8= -golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= -golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= -golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= -google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/libgm/go.mod b/libgm/go.mod deleted file mode 100644 index 461c411..0000000 --- a/libgm/go.mod +++ /dev/null @@ -1,22 +0,0 @@ -module go.mau.fi/mautrix-gmessages/libgm - -go 1.21 - -require ( - github.com/google/uuid v1.6.0 - github.com/rs/zerolog v1.33.0 - github.com/stretchr/testify v1.9.0 - go.mau.fi/util v0.6.1-0.20240722085753-2d7945696c9b - golang.org/x/crypto v0.25.0 - golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 - google.golang.org/protobuf v1.34.2 -) - -require ( - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.19 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - golang.org/x/sys v0.22.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect -) diff --git a/libgm/go.sum b/libgm/go.sum deleted file mode 100644 index 707c4a0..0000000 --- a/libgm/go.sum +++ /dev/null @@ -1,38 +0,0 @@ -github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= -github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= -github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= -github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= -github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -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= -github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= -github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -go.mau.fi/util v0.6.1-0.20240722085753-2d7945696c9b h1:8s3uTMPZts03evXLqdTJ0WXB0YWZDNSovpd6oFfCFvY= -go.mau.fi/util v0.6.1-0.20240722085753-2d7945696c9b/go.mod h1:ljYdq3sPfpICc3zMU+/mHV/sa4z0nKxc67hSBwnrk8U= -golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= -golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= -golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8= -golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= -golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= -golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= -google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/pkg/connector/backfill.go b/pkg/connector/backfill.go index 9113a8d..fab6511 100644 --- a/pkg/connector/backfill.go +++ b/pkg/connector/backfill.go @@ -28,8 +28,8 @@ import ( "maunium.net/go/mautrix/bridgev2" "maunium.net/go/mautrix/bridgev2/networkid" - "go.mau.fi/mautrix-gmessages/libgm" - "go.mau.fi/mautrix-gmessages/libgm/gmproto" + "go.mau.fi/mautrix-gmessages/pkg/libgm" + "go.mau.fi/mautrix-gmessages/pkg/libgm/gmproto" ) var _ bridgev2.BackfillingNetworkAPI = (*GMClient)(nil) diff --git a/pkg/connector/capabilities.go b/pkg/connector/capabilities.go index 900149e..90c10b2 100644 --- a/pkg/connector/capabilities.go +++ b/pkg/connector/capabilities.go @@ -22,7 +22,7 @@ import ( "maunium.net/go/mautrix/bridgev2" "maunium.net/go/mautrix/bridgev2/database" - "go.mau.fi/mautrix-gmessages/libgm/gmproto" + "go.mau.fi/mautrix-gmessages/pkg/libgm/gmproto" ) var generalCaps = &bridgev2.NetworkGeneralCapabilities{ diff --git a/pkg/connector/chatinfo.go b/pkg/connector/chatinfo.go index e5fae28..55e9645 100644 --- a/pkg/connector/chatinfo.go +++ b/pkg/connector/chatinfo.go @@ -31,7 +31,7 @@ import ( "maunium.net/go/mautrix/bridgev2/networkid" "maunium.net/go/mautrix/event" - "go.mau.fi/mautrix-gmessages/libgm/gmproto" + "go.mau.fi/mautrix-gmessages/pkg/libgm/gmproto" ) var _ bridgev2.PortalBridgeInfoFillingNetwork = (*GMConnector)(nil) diff --git a/pkg/connector/chatsync.go b/pkg/connector/chatsync.go index 2cb62b3..2acb7e2 100644 --- a/pkg/connector/chatsync.go +++ b/pkg/connector/chatsync.go @@ -27,7 +27,7 @@ import ( "maunium.net/go/mautrix/bridgev2/networkid" "maunium.net/go/mautrix/bridgev2/simplevent" - "go.mau.fi/mautrix-gmessages/libgm/gmproto" + "go.mau.fi/mautrix-gmessages/pkg/libgm/gmproto" ) func (gc *GMClient) SyncConversations(ctx context.Context, lastDataReceived time.Time, minimalSync bool) { diff --git a/pkg/connector/client.go b/pkg/connector/client.go index e21a675..e28a267 100644 --- a/pkg/connector/client.go +++ b/pkg/connector/client.go @@ -29,8 +29,8 @@ import ( "maunium.net/go/mautrix/bridgev2" "maunium.net/go/mautrix/bridgev2/networkid" - "go.mau.fi/mautrix-gmessages/libgm" - "go.mau.fi/mautrix-gmessages/libgm/gmproto" + "go.mau.fi/mautrix-gmessages/pkg/libgm" + "go.mau.fi/mautrix-gmessages/pkg/libgm/gmproto" ) type conversationMeta struct { diff --git a/pkg/connector/connector.go b/pkg/connector/connector.go index 3eb5dd4..b38d668 100644 --- a/pkg/connector/connector.go +++ b/pkg/connector/connector.go @@ -21,9 +21,9 @@ import ( "maunium.net/go/mautrix/bridgev2" - "go.mau.fi/mautrix-gmessages/libgm/gmproto" - "go.mau.fi/mautrix-gmessages/libgm/util" "go.mau.fi/mautrix-gmessages/pkg/connector/gmdb" + "go.mau.fi/mautrix-gmessages/pkg/libgm/gmproto" + "go.mau.fi/mautrix-gmessages/pkg/libgm/util" ) type GMConnector struct { diff --git a/pkg/connector/dbmeta.go b/pkg/connector/dbmeta.go index 21be80f..8530681 100644 --- a/pkg/connector/dbmeta.go +++ b/pkg/connector/dbmeta.go @@ -25,8 +25,8 @@ import ( "go.mau.fi/util/jsontime" "maunium.net/go/mautrix/bridgev2/database" - "go.mau.fi/mautrix-gmessages/libgm" - "go.mau.fi/mautrix-gmessages/libgm/gmproto" + "go.mau.fi/mautrix-gmessages/pkg/libgm" + "go.mau.fi/mautrix-gmessages/pkg/libgm/gmproto" ) func (gc *GMConnector) GetDBMetaTypes() database.MetaTypes { diff --git a/pkg/connector/errors.go b/pkg/connector/errors.go index 978785a..5423633 100644 --- a/pkg/connector/errors.go +++ b/pkg/connector/errors.go @@ -20,7 +20,7 @@ import ( "fmt" "strings" - "go.mau.fi/mautrix-gmessages/libgm/gmproto" + "go.mau.fi/mautrix-gmessages/pkg/libgm/gmproto" ) var () diff --git a/pkg/connector/handlegmessages.go b/pkg/connector/handlegmessages.go index befadb9..9f0690e 100644 --- a/pkg/connector/handlegmessages.go +++ b/pkg/connector/handlegmessages.go @@ -39,9 +39,9 @@ import ( "maunium.net/go/mautrix/event" "maunium.net/go/mautrix/id" - "go.mau.fi/mautrix-gmessages/libgm" - "go.mau.fi/mautrix-gmessages/libgm/events" - "go.mau.fi/mautrix-gmessages/libgm/gmproto" + "go.mau.fi/mautrix-gmessages/pkg/libgm" + "go.mau.fi/mautrix-gmessages/pkg/libgm/events" + "go.mau.fi/mautrix-gmessages/pkg/libgm/gmproto" ) func (gc *GMClient) handleGMEvent(rawEvt any) { diff --git a/pkg/connector/handlematrix.go b/pkg/connector/handlematrix.go index 13c981e..878f52e 100644 --- a/pkg/connector/handlematrix.go +++ b/pkg/connector/handlematrix.go @@ -30,8 +30,8 @@ import ( "maunium.net/go/mautrix/bridgev2/networkid" "maunium.net/go/mautrix/event" - "go.mau.fi/mautrix-gmessages/libgm/gmproto" - "go.mau.fi/mautrix-gmessages/libgm/util" + "go.mau.fi/mautrix-gmessages/pkg/libgm/gmproto" + "go.mau.fi/mautrix-gmessages/pkg/libgm/util" ) var ( diff --git a/pkg/connector/login.go b/pkg/connector/login.go index fa96e44..70e1bfb 100644 --- a/pkg/connector/login.go +++ b/pkg/connector/login.go @@ -28,8 +28,8 @@ import ( "maunium.net/go/mautrix/bridgev2/database" "maunium.net/go/mautrix/bridgev2/networkid" - "go.mau.fi/mautrix-gmessages/libgm" - "go.mau.fi/mautrix-gmessages/libgm/gmproto" + "go.mau.fi/mautrix-gmessages/pkg/libgm" + "go.mau.fi/mautrix-gmessages/pkg/libgm/gmproto" ) const ( diff --git a/pkg/connector/messagestatus.go b/pkg/connector/messagestatus.go index 08e325f..7bb1430 100644 --- a/pkg/connector/messagestatus.go +++ b/pkg/connector/messagestatus.go @@ -22,7 +22,7 @@ import ( "maunium.net/go/mautrix/bridgev2" - "go.mau.fi/mautrix-gmessages/libgm/gmproto" + "go.mau.fi/mautrix-gmessages/pkg/libgm/gmproto" ) func isSuccessfullySentStatus(status gmproto.MessageStatusType) bool { diff --git a/pkg/connector/startchat.go b/pkg/connector/startchat.go index d682f47..c59bbcb 100644 --- a/pkg/connector/startchat.go +++ b/pkg/connector/startchat.go @@ -30,7 +30,7 @@ import ( "maunium.net/go/mautrix/bridgev2" "maunium.net/go/mautrix/bridgev2/networkid" - "go.mau.fi/mautrix-gmessages/libgm/gmproto" + "go.mau.fi/mautrix-gmessages/pkg/libgm/gmproto" ) var ( diff --git a/libgm/client.go b/pkg/libgm/client.go similarity index 98% rename from libgm/client.go rename to pkg/libgm/client.go index 3afd047..f4643de 100644 --- a/libgm/client.go +++ b/pkg/libgm/client.go @@ -16,10 +16,10 @@ import ( "github.com/google/uuid" "github.com/rs/zerolog" - "go.mau.fi/mautrix-gmessages/libgm/crypto" - "go.mau.fi/mautrix-gmessages/libgm/events" - "go.mau.fi/mautrix-gmessages/libgm/gmproto" - "go.mau.fi/mautrix-gmessages/libgm/util" + "go.mau.fi/mautrix-gmessages/pkg/libgm/crypto" + "go.mau.fi/mautrix-gmessages/pkg/libgm/events" + "go.mau.fi/mautrix-gmessages/pkg/libgm/gmproto" + "go.mau.fi/mautrix-gmessages/pkg/libgm/util" ) type AuthData struct { diff --git a/libgm/crypto/aesctr.go b/pkg/libgm/crypto/aesctr.go similarity index 100% rename from libgm/crypto/aesctr.go rename to pkg/libgm/crypto/aesctr.go diff --git a/libgm/crypto/aesgcm.go b/pkg/libgm/crypto/aesgcm.go similarity index 100% rename from libgm/crypto/aesgcm.go rename to pkg/libgm/crypto/aesgcm.go diff --git a/libgm/crypto/ecdsa.go b/pkg/libgm/crypto/ecdsa.go similarity index 100% rename from libgm/crypto/ecdsa.go rename to pkg/libgm/crypto/ecdsa.go diff --git a/libgm/crypto/generate.go b/pkg/libgm/crypto/generate.go similarity index 100% rename from libgm/crypto/generate.go rename to pkg/libgm/crypto/generate.go diff --git a/libgm/event_handler.go b/pkg/libgm/event_handler.go similarity index 99% rename from libgm/event_handler.go rename to pkg/libgm/event_handler.go index 8bb6eaf..b112058 100644 --- a/libgm/event_handler.go +++ b/pkg/libgm/event_handler.go @@ -9,8 +9,8 @@ import ( "google.golang.org/protobuf/proto" - "go.mau.fi/mautrix-gmessages/libgm/events" - "go.mau.fi/mautrix-gmessages/libgm/gmproto" + "go.mau.fi/mautrix-gmessages/pkg/libgm/events" + "go.mau.fi/mautrix-gmessages/pkg/libgm/gmproto" ) type IncomingRPCMessage struct { diff --git a/libgm/events/qr.go b/pkg/libgm/events/qr.go similarity index 73% rename from libgm/events/qr.go rename to pkg/libgm/events/qr.go index c69dd88..1108e39 100644 --- a/libgm/events/qr.go +++ b/pkg/libgm/events/qr.go @@ -1,7 +1,7 @@ package events import ( - "go.mau.fi/mautrix-gmessages/libgm/gmproto" + "go.mau.fi/mautrix-gmessages/pkg/libgm/gmproto" ) type QR struct { diff --git a/libgm/events/ready.go b/pkg/libgm/events/ready.go similarity index 97% rename from libgm/events/ready.go rename to pkg/libgm/events/ready.go index ddddecc..f27400b 100644 --- a/libgm/events/ready.go +++ b/pkg/libgm/events/ready.go @@ -5,7 +5,7 @@ import ( "fmt" "net/http" - "go.mau.fi/mautrix-gmessages/libgm/gmproto" + "go.mau.fi/mautrix-gmessages/pkg/libgm/gmproto" ) type ClientReady struct { diff --git a/libgm/events/ready_test.go b/pkg/libgm/events/ready_test.go similarity index 87% rename from libgm/events/ready_test.go rename to pkg/libgm/events/ready_test.go index 6b14957..1b17672 100644 --- a/libgm/events/ready_test.go +++ b/pkg/libgm/events/ready_test.go @@ -8,9 +8,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.mau.fi/mautrix-gmessages/libgm/events" - "go.mau.fi/mautrix-gmessages/libgm/gmproto" - "go.mau.fi/mautrix-gmessages/libgm/pblite" + "go.mau.fi/mautrix-gmessages/pkg/libgm/events" + "go.mau.fi/mautrix-gmessages/pkg/libgm/gmproto" + "go.mau.fi/mautrix-gmessages/pkg/libgm/pblite" ) func TestRequestError_Is(t *testing.T) { diff --git a/libgm/events/useralerts.go b/pkg/libgm/events/useralerts.go similarity index 100% rename from libgm/events/useralerts.go rename to pkg/libgm/events/useralerts.go diff --git a/libgm/gmproto/authentication.pb.go b/pkg/libgm/gmproto/authentication.pb.go similarity index 100% rename from libgm/gmproto/authentication.pb.go rename to pkg/libgm/gmproto/authentication.pb.go diff --git a/libgm/gmproto/authentication.pb.raw b/pkg/libgm/gmproto/authentication.pb.raw similarity index 100% rename from libgm/gmproto/authentication.pb.raw rename to pkg/libgm/gmproto/authentication.pb.raw diff --git a/libgm/gmproto/authentication.proto b/pkg/libgm/gmproto/authentication.proto similarity index 100% rename from libgm/gmproto/authentication.proto rename to pkg/libgm/gmproto/authentication.proto diff --git a/libgm/gmproto/client.pb.go b/pkg/libgm/gmproto/client.pb.go similarity index 100% rename from libgm/gmproto/client.pb.go rename to pkg/libgm/gmproto/client.pb.go diff --git a/libgm/gmproto/client.pb.raw b/pkg/libgm/gmproto/client.pb.raw similarity index 100% rename from libgm/gmproto/client.pb.raw rename to pkg/libgm/gmproto/client.pb.raw diff --git a/libgm/gmproto/client.proto b/pkg/libgm/gmproto/client.proto similarity index 100% rename from libgm/gmproto/client.proto rename to pkg/libgm/gmproto/client.proto diff --git a/libgm/gmproto/config-extra.go b/pkg/libgm/gmproto/config-extra.go similarity index 100% rename from libgm/gmproto/config-extra.go rename to pkg/libgm/gmproto/config-extra.go diff --git a/libgm/gmproto/config.pb.go b/pkg/libgm/gmproto/config.pb.go similarity index 100% rename from libgm/gmproto/config.pb.go rename to pkg/libgm/gmproto/config.pb.go diff --git a/libgm/gmproto/config.pb.raw b/pkg/libgm/gmproto/config.pb.raw similarity index 100% rename from libgm/gmproto/config.pb.raw rename to pkg/libgm/gmproto/config.pb.raw diff --git a/libgm/gmproto/config.proto b/pkg/libgm/gmproto/config.proto similarity index 100% rename from libgm/gmproto/config.proto rename to pkg/libgm/gmproto/config.proto diff --git a/libgm/gmproto/conversations.pb.go b/pkg/libgm/gmproto/conversations.pb.go similarity index 100% rename from libgm/gmproto/conversations.pb.go rename to pkg/libgm/gmproto/conversations.pb.go diff --git a/libgm/gmproto/conversations.pb.raw b/pkg/libgm/gmproto/conversations.pb.raw similarity index 100% rename from libgm/gmproto/conversations.pb.raw rename to pkg/libgm/gmproto/conversations.pb.raw diff --git a/libgm/gmproto/conversations.proto b/pkg/libgm/gmproto/conversations.proto similarity index 100% rename from libgm/gmproto/conversations.proto rename to pkg/libgm/gmproto/conversations.proto diff --git a/libgm/gmproto/emojitype.go b/pkg/libgm/gmproto/emojitype.go similarity index 100% rename from libgm/gmproto/emojitype.go rename to pkg/libgm/gmproto/emojitype.go diff --git a/libgm/gmproto/events.pb.go b/pkg/libgm/gmproto/events.pb.go similarity index 100% rename from libgm/gmproto/events.pb.go rename to pkg/libgm/gmproto/events.pb.go diff --git a/libgm/gmproto/events.pb.raw b/pkg/libgm/gmproto/events.pb.raw similarity index 100% rename from libgm/gmproto/events.pb.raw rename to pkg/libgm/gmproto/events.pb.raw diff --git a/libgm/gmproto/events.proto b/pkg/libgm/gmproto/events.proto similarity index 100% rename from libgm/gmproto/events.proto rename to pkg/libgm/gmproto/events.proto diff --git a/libgm/gmproto/pblite.pb.go b/pkg/libgm/gmproto/pblite.pb.go similarity index 100% rename from libgm/gmproto/pblite.pb.go rename to pkg/libgm/gmproto/pblite.pb.go diff --git a/libgm/gmproto/pblite.pb.raw b/pkg/libgm/gmproto/pblite.pb.raw similarity index 100% rename from libgm/gmproto/pblite.pb.raw rename to pkg/libgm/gmproto/pblite.pb.raw diff --git a/libgm/gmproto/pblite.proto b/pkg/libgm/gmproto/pblite.proto similarity index 100% rename from libgm/gmproto/pblite.proto rename to pkg/libgm/gmproto/pblite.proto diff --git a/libgm/gmproto/rpc.pb.go b/pkg/libgm/gmproto/rpc.pb.go similarity index 100% rename from libgm/gmproto/rpc.pb.go rename to pkg/libgm/gmproto/rpc.pb.go diff --git a/libgm/gmproto/rpc.pb.raw b/pkg/libgm/gmproto/rpc.pb.raw similarity index 100% rename from libgm/gmproto/rpc.pb.raw rename to pkg/libgm/gmproto/rpc.pb.raw diff --git a/libgm/gmproto/rpc.proto b/pkg/libgm/gmproto/rpc.proto similarity index 100% rename from libgm/gmproto/rpc.proto rename to pkg/libgm/gmproto/rpc.proto diff --git a/libgm/gmproto/settings.pb.go b/pkg/libgm/gmproto/settings.pb.go similarity index 100% rename from libgm/gmproto/settings.pb.go rename to pkg/libgm/gmproto/settings.pb.go diff --git a/libgm/gmproto/settings.pb.raw b/pkg/libgm/gmproto/settings.pb.raw similarity index 100% rename from libgm/gmproto/settings.pb.raw rename to pkg/libgm/gmproto/settings.pb.raw diff --git a/libgm/gmproto/settings.proto b/pkg/libgm/gmproto/settings.proto similarity index 100% rename from libgm/gmproto/settings.proto rename to pkg/libgm/gmproto/settings.proto diff --git a/libgm/gmproto/ukey.pb.go b/pkg/libgm/gmproto/ukey.pb.go similarity index 100% rename from libgm/gmproto/ukey.pb.go rename to pkg/libgm/gmproto/ukey.pb.go diff --git a/libgm/gmproto/ukey.pb.raw b/pkg/libgm/gmproto/ukey.pb.raw similarity index 100% rename from libgm/gmproto/ukey.pb.raw rename to pkg/libgm/gmproto/ukey.pb.raw diff --git a/libgm/gmproto/ukey.proto b/pkg/libgm/gmproto/ukey.proto similarity index 100% rename from libgm/gmproto/ukey.proto rename to pkg/libgm/gmproto/ukey.proto diff --git a/libgm/gmproto/util.pb.go b/pkg/libgm/gmproto/util.pb.go similarity index 100% rename from libgm/gmproto/util.pb.go rename to pkg/libgm/gmproto/util.pb.go diff --git a/libgm/gmproto/util.pb.raw b/pkg/libgm/gmproto/util.pb.raw similarity index 100% rename from libgm/gmproto/util.pb.raw rename to pkg/libgm/gmproto/util.pb.raw diff --git a/libgm/gmproto/util.proto b/pkg/libgm/gmproto/util.proto similarity index 100% rename from libgm/gmproto/util.proto rename to pkg/libgm/gmproto/util.proto diff --git a/libgm/gmtest/.gitignore b/pkg/libgm/gmtest/.gitignore similarity index 100% rename from libgm/gmtest/.gitignore rename to pkg/libgm/gmtest/.gitignore diff --git a/libgm/gmtest/main.go b/pkg/libgm/gmtest/main.go similarity index 95% rename from libgm/gmtest/main.go rename to pkg/libgm/gmtest/main.go index ad58ef7..02b1b79 100644 --- a/libgm/gmtest/main.go +++ b/pkg/libgm/gmtest/main.go @@ -14,9 +14,9 @@ import ( "github.com/rs/zerolog" - "go.mau.fi/mautrix-gmessages/libgm" - "go.mau.fi/mautrix-gmessages/libgm/events" - "go.mau.fi/mautrix-gmessages/libgm/gmproto" + "go.mau.fi/mautrix-gmessages/pkg/libgm" + "go.mau.fi/mautrix-gmessages/pkg/libgm/events" + "go.mau.fi/mautrix-gmessages/pkg/libgm/gmproto" ) func must(err error) { diff --git a/libgm/http.go b/pkg/libgm/http.go similarity index 95% rename from libgm/http.go rename to pkg/libgm/http.go index 3ca42d9..db2796e 100644 --- a/libgm/http.go +++ b/pkg/libgm/http.go @@ -14,10 +14,10 @@ import ( "github.com/rs/zerolog" "google.golang.org/protobuf/proto" - "go.mau.fi/mautrix-gmessages/libgm/events" - "go.mau.fi/mautrix-gmessages/libgm/gmproto" - "go.mau.fi/mautrix-gmessages/libgm/pblite" - "go.mau.fi/mautrix-gmessages/libgm/util" + "go.mau.fi/mautrix-gmessages/pkg/libgm/events" + "go.mau.fi/mautrix-gmessages/pkg/libgm/gmproto" + "go.mau.fi/mautrix-gmessages/pkg/libgm/pblite" + "go.mau.fi/mautrix-gmessages/pkg/libgm/util" ) const ContentTypeProtobuf = "application/x-protobuf" diff --git a/libgm/longpoll.go b/pkg/libgm/longpoll.go similarity index 98% rename from libgm/longpoll.go rename to pkg/libgm/longpoll.go index 503d0c7..73202ca 100644 --- a/libgm/longpoll.go +++ b/pkg/libgm/longpoll.go @@ -17,11 +17,11 @@ import ( "github.com/google/uuid" "github.com/rs/zerolog" - "go.mau.fi/mautrix-gmessages/libgm/events" - "go.mau.fi/mautrix-gmessages/libgm/pblite" + "go.mau.fi/mautrix-gmessages/pkg/libgm/events" + "go.mau.fi/mautrix-gmessages/pkg/libgm/pblite" - "go.mau.fi/mautrix-gmessages/libgm/gmproto" - "go.mau.fi/mautrix-gmessages/libgm/util" + "go.mau.fi/mautrix-gmessages/pkg/libgm/gmproto" + "go.mau.fi/mautrix-gmessages/pkg/libgm/util" ) const defaultPingTimeout = 1 * time.Minute diff --git a/libgm/manualdecrypt/README.md b/pkg/libgm/manualdecrypt/README.md similarity index 100% rename from libgm/manualdecrypt/README.md rename to pkg/libgm/manualdecrypt/README.md diff --git a/libgm/manualdecrypt/main.go b/pkg/libgm/manualdecrypt/main.go similarity index 97% rename from libgm/manualdecrypt/main.go rename to pkg/libgm/manualdecrypt/main.go index e8d5469..98efeb9 100644 --- a/libgm/manualdecrypt/main.go +++ b/pkg/libgm/manualdecrypt/main.go @@ -13,9 +13,9 @@ import ( "google.golang.org/protobuf/proto" - "go.mau.fi/mautrix-gmessages/libgm/crypto" - "go.mau.fi/mautrix-gmessages/libgm/gmproto" - "go.mau.fi/mautrix-gmessages/libgm/pblite" + "go.mau.fi/mautrix-gmessages/pkg/libgm/crypto" + "go.mau.fi/mautrix-gmessages/pkg/libgm/gmproto" + "go.mau.fi/mautrix-gmessages/pkg/libgm/pblite" ) func must[T any](t T, err error) T { diff --git a/libgm/media.go b/pkg/libgm/media.go similarity index 98% rename from libgm/media.go rename to pkg/libgm/media.go index 6dc352d..194e2ab 100644 --- a/libgm/media.go +++ b/pkg/libgm/media.go @@ -12,9 +12,9 @@ import ( "github.com/google/uuid" "google.golang.org/protobuf/proto" - "go.mau.fi/mautrix-gmessages/libgm/crypto" - "go.mau.fi/mautrix-gmessages/libgm/gmproto" - "go.mau.fi/mautrix-gmessages/libgm/util" + "go.mau.fi/mautrix-gmessages/pkg/libgm/crypto" + "go.mau.fi/mautrix-gmessages/pkg/libgm/gmproto" + "go.mau.fi/mautrix-gmessages/pkg/libgm/util" ) type MediaType struct { diff --git a/libgm/methods.go b/pkg/libgm/methods.go similarity index 99% rename from libgm/methods.go rename to pkg/libgm/methods.go index d79b802..aa87247 100644 --- a/libgm/methods.go +++ b/pkg/libgm/methods.go @@ -1,7 +1,7 @@ package libgm import ( - "go.mau.fi/mautrix-gmessages/libgm/gmproto" + "go.mau.fi/mautrix-gmessages/pkg/libgm/gmproto" ) func (c *Client) ListConversations(count int, folder gmproto.ListConversationsRequest_Folder) (*gmproto.ListConversationsResponse, error) { diff --git a/libgm/pair.go b/pkg/libgm/pair.go similarity index 96% rename from libgm/pair.go rename to pkg/libgm/pair.go index 5c71834..b466891 100644 --- a/libgm/pair.go +++ b/pkg/libgm/pair.go @@ -9,9 +9,9 @@ import ( "github.com/google/uuid" "google.golang.org/protobuf/proto" - "go.mau.fi/mautrix-gmessages/libgm/events" - "go.mau.fi/mautrix-gmessages/libgm/gmproto" - "go.mau.fi/mautrix-gmessages/libgm/util" + "go.mau.fi/mautrix-gmessages/pkg/libgm/events" + "go.mau.fi/mautrix-gmessages/pkg/libgm/gmproto" + "go.mau.fi/mautrix-gmessages/pkg/libgm/util" ) func (c *Client) StartLogin() (string, error) { diff --git a/libgm/pair_google.go b/pkg/libgm/pair_google.go similarity index 99% rename from libgm/pair_google.go rename to pkg/libgm/pair_google.go index c1cd4aa..ffa4f99 100644 --- a/libgm/pair_google.go +++ b/pkg/libgm/pair_google.go @@ -43,9 +43,9 @@ import ( "golang.org/x/crypto/hkdf" "google.golang.org/protobuf/proto" - "go.mau.fi/mautrix-gmessages/libgm/events" - "go.mau.fi/mautrix-gmessages/libgm/gmproto" - "go.mau.fi/mautrix-gmessages/libgm/util" + "go.mau.fi/mautrix-gmessages/pkg/libgm/events" + "go.mau.fi/mautrix-gmessages/pkg/libgm/gmproto" + "go.mau.fi/mautrix-gmessages/pkg/libgm/util" ) func (c *Client) handleGaiaPairingEvent(msg *IncomingRPCMessage) { diff --git a/libgm/pblite/deserialize.go b/pkg/libgm/pblite/deserialize.go similarity index 99% rename from libgm/pblite/deserialize.go rename to pkg/libgm/pblite/deserialize.go index e177add..be9b30a 100644 --- a/libgm/pblite/deserialize.go +++ b/pkg/libgm/pblite/deserialize.go @@ -10,7 +10,7 @@ import ( "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/types/descriptorpb" - "go.mau.fi/mautrix-gmessages/libgm/gmproto" + "go.mau.fi/mautrix-gmessages/pkg/libgm/gmproto" ) func Unmarshal(data []byte, m proto.Message) error { diff --git a/libgm/pblite/serialize.go b/pkg/libgm/pblite/serialize.go similarity index 100% rename from libgm/pblite/serialize.go rename to pkg/libgm/pblite/serialize.go diff --git a/libgm/pblitedecode/main.go b/pkg/libgm/pblitedecode/main.go similarity index 91% rename from libgm/pblitedecode/main.go rename to pkg/libgm/pblitedecode/main.go index 17c95fe..55c3e2d 100644 --- a/libgm/pblitedecode/main.go +++ b/pkg/libgm/pblitedecode/main.go @@ -9,8 +9,8 @@ import ( "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/types/dynamicpb" - "go.mau.fi/mautrix-gmessages/libgm/gmproto" - "go.mau.fi/mautrix-gmessages/libgm/pblite" + "go.mau.fi/mautrix-gmessages/pkg/libgm/gmproto" + "go.mau.fi/mautrix-gmessages/pkg/libgm/pblite" ) func must[T any](t T, err error) T { diff --git a/libgm/session_handler.go b/pkg/libgm/session_handler.go similarity index 98% rename from libgm/session_handler.go rename to pkg/libgm/session_handler.go index ce01b7f..0f26e13 100644 --- a/libgm/session_handler.go +++ b/pkg/libgm/session_handler.go @@ -11,8 +11,8 @@ import ( "golang.org/x/exp/slices" "google.golang.org/protobuf/proto" - "go.mau.fi/mautrix-gmessages/libgm/gmproto" - "go.mau.fi/mautrix-gmessages/libgm/util" + "go.mau.fi/mautrix-gmessages/pkg/libgm/gmproto" + "go.mau.fi/mautrix-gmessages/pkg/libgm/util" ) type SessionHandler struct { diff --git a/libgm/util/config.go b/pkg/libgm/util/config.go similarity index 88% rename from libgm/util/config.go rename to pkg/libgm/util/config.go index 25f9e50..e0b9083 100644 --- a/libgm/util/config.go +++ b/pkg/libgm/util/config.go @@ -1,7 +1,7 @@ package util import ( - "go.mau.fi/mautrix-gmessages/libgm/gmproto" + "go.mau.fi/mautrix-gmessages/pkg/libgm/gmproto" ) var ConfigMessage = &gmproto.ConfigVersion{ diff --git a/libgm/util/constants.go b/pkg/libgm/util/constants.go similarity index 100% rename from libgm/util/constants.go rename to pkg/libgm/util/constants.go diff --git a/libgm/util/func.go b/pkg/libgm/util/func.go similarity index 100% rename from libgm/util/func.go rename to pkg/libgm/util/func.go diff --git a/libgm/util/paths.go b/pkg/libgm/util/paths.go similarity index 100% rename from libgm/util/paths.go rename to pkg/libgm/util/paths.go