mirror of
https://github.com/tulir/mautrix-whatsapp
synced 2024-12-12 16:43:27 +01:00
Update mautrix-go
This commit is contained in:
parent
46e53eca4d
commit
91db286208
3 changed files with 19 additions and 1 deletions
|
@ -355,6 +355,22 @@ func (store *SQLCryptoStore) GetDevices(userID id.UserID) (map[id.DeviceID]*cryp
|
|||
return data, nil
|
||||
}
|
||||
|
||||
func (store *SQLCryptoStore) GetDevice(userID id.UserID, deviceID id.DeviceID) (*crypto.DeviceIdentity, error) {
|
||||
var identity crypto.DeviceIdentity
|
||||
err := store.db.QueryRow(`
|
||||
SELECT identity_key, signing_key, trust, deleted, name
|
||||
FROM crypto_device WHERE user_id=$1 AND device_id=$2`,
|
||||
userID, deviceID,
|
||||
).Scan(&identity.IdentityKey, &identity.SigningKey, &identity.Trust, &identity.Deleted, &identity.Name)
|
||||
if err != nil {
|
||||
if err == sql.ErrNoRows {
|
||||
return nil, nil
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
return &identity, nil
|
||||
}
|
||||
|
||||
func (store *SQLCryptoStore) PutDevices(userID id.UserID, devices map[id.DeviceID]*crypto.DeviceIdentity) error {
|
||||
tx, err := store.db.Begin()
|
||||
if err != nil {
|
||||
|
|
2
go.mod
2
go.mod
|
@ -15,7 +15,7 @@ require (
|
|||
gopkg.in/yaml.v2 v2.2.8
|
||||
maunium.net/go/mauflag v1.0.0
|
||||
maunium.net/go/maulogger/v2 v2.1.1
|
||||
maunium.net/go/mautrix v0.4.5
|
||||
maunium.net/go/mautrix v0.4.7
|
||||
)
|
||||
|
||||
replace github.com/Rhymen/go-whatsapp => github.com/tulir/go-whatsapp v0.2.8
|
||||
|
|
2
go.sum
2
go.sum
|
@ -100,3 +100,5 @@ maunium.net/go/mautrix v0.4.4 h1:C5yYDzUdRtJj/9Vot5YBPQUsWmn19sTySew7f4ACLhM=
|
|||
maunium.net/go/mautrix v0.4.4/go.mod h1:8Y+NqmROJyWYvvP4yPfX9tLM59VCfgE/kcQ0SeX68ho=
|
||||
maunium.net/go/mautrix v0.4.5 h1:cQhlPURW0TGjlqEoac+4+J/aS5/Rg8x1b+fiFZZz6LI=
|
||||
maunium.net/go/mautrix v0.4.5/go.mod h1:8Y+NqmROJyWYvvP4yPfX9tLM59VCfgE/kcQ0SeX68ho=
|
||||
maunium.net/go/mautrix v0.4.7 h1:jpclbeGcuiHPIWZFZhQJoxgZKP9f+9OLBPtcDNMFV/o=
|
||||
maunium.net/go/mautrix v0.4.7/go.mod h1:8Y+NqmROJyWYvvP4yPfX9tLM59VCfgE/kcQ0SeX68ho=
|
||||
|
|
Loading…
Reference in a new issue