mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-02 06:12:45 +00:00
* Fix #897 and shuffle directory around * Update find-lint * goimports Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
This commit is contained in:
parent
3fdb045116
commit
24d8df664c
260 changed files with 901 additions and 901 deletions
|
@ -21,7 +21,7 @@ import (
|
|||
"errors"
|
||||
|
||||
"github.com/lib/pq"
|
||||
"github.com/matrix-org/dendrite/common"
|
||||
"github.com/matrix-org/dendrite/internal"
|
||||
"github.com/matrix-org/dendrite/roomserver/types"
|
||||
"github.com/matrix-org/gomatrixserverlib"
|
||||
)
|
||||
|
@ -103,7 +103,7 @@ func (s *roomStatements) insertRoomNID(
|
|||
roomID string, roomVersion gomatrixserverlib.RoomVersion,
|
||||
) (types.RoomNID, error) {
|
||||
var roomNID int64
|
||||
stmt := common.TxStmt(txn, s.insertRoomNIDStmt)
|
||||
stmt := internal.TxStmt(txn, s.insertRoomNIDStmt)
|
||||
err := stmt.QueryRowContext(ctx, roomID, roomVersion).Scan(&roomNID)
|
||||
return types.RoomNID(roomNID), err
|
||||
}
|
||||
|
@ -112,7 +112,7 @@ func (s *roomStatements) selectRoomNID(
|
|||
ctx context.Context, txn *sql.Tx, roomID string,
|
||||
) (types.RoomNID, error) {
|
||||
var roomNID int64
|
||||
stmt := common.TxStmt(txn, s.selectRoomNIDStmt)
|
||||
stmt := internal.TxStmt(txn, s.selectRoomNIDStmt)
|
||||
err := stmt.QueryRowContext(ctx, roomID).Scan(&roomNID)
|
||||
return types.RoomNID(roomNID), err
|
||||
}
|
||||
|
@ -140,7 +140,7 @@ func (s *roomStatements) selectLatestEventsNIDsForUpdate(
|
|||
var nids pq.Int64Array
|
||||
var lastEventSentNID int64
|
||||
var stateSnapshotNID int64
|
||||
stmt := common.TxStmt(txn, s.selectLatestEventNIDsForUpdateStmt)
|
||||
stmt := internal.TxStmt(txn, s.selectLatestEventNIDsForUpdateStmt)
|
||||
err := stmt.QueryRowContext(ctx, int64(roomNID)).Scan(&nids, &lastEventSentNID, &stateSnapshotNID)
|
||||
if err != nil {
|
||||
return nil, 0, 0, err
|
||||
|
@ -160,7 +160,7 @@ func (s *roomStatements) updateLatestEventNIDs(
|
|||
lastEventSentNID types.EventNID,
|
||||
stateSnapshotNID types.StateSnapshotNID,
|
||||
) error {
|
||||
stmt := common.TxStmt(txn, s.updateLatestEventNIDsStmt)
|
||||
stmt := internal.TxStmt(txn, s.updateLatestEventNIDsStmt)
|
||||
_, err := stmt.ExecContext(
|
||||
ctx,
|
||||
roomNID,
|
||||
|
@ -175,7 +175,7 @@ func (s *roomStatements) selectRoomVersionForRoomID(
|
|||
ctx context.Context, txn *sql.Tx, roomID string,
|
||||
) (gomatrixserverlib.RoomVersion, error) {
|
||||
var roomVersion gomatrixserverlib.RoomVersion
|
||||
stmt := common.TxStmt(txn, s.selectRoomVersionForRoomIDStmt)
|
||||
stmt := internal.TxStmt(txn, s.selectRoomVersionForRoomIDStmt)
|
||||
err := stmt.QueryRowContext(ctx, roomID).Scan(&roomVersion)
|
||||
if err == sql.ErrNoRows {
|
||||
return roomVersion, errors.New("room not found")
|
||||
|
@ -187,7 +187,7 @@ func (s *roomStatements) selectRoomVersionForRoomNID(
|
|||
ctx context.Context, txn *sql.Tx, roomNID types.RoomNID,
|
||||
) (gomatrixserverlib.RoomVersion, error) {
|
||||
var roomVersion gomatrixserverlib.RoomVersion
|
||||
stmt := common.TxStmt(txn, s.selectRoomVersionForRoomNIDStmt)
|
||||
stmt := internal.TxStmt(txn, s.selectRoomVersionForRoomNIDStmt)
|
||||
err := stmt.QueryRowContext(ctx, roomNID).Scan(&roomVersion)
|
||||
if err == sql.ErrNoRows {
|
||||
return roomVersion, errors.New("room not found")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue