mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-02 14:12:47 +00:00
Merge keyserver & userapi (#2972)
As discussed yesterday, a first draft of merging the keyserver and the userapi.
This commit is contained in:
parent
bd6f0c14e5
commit
4594233f89
107 changed files with 1730 additions and 1863 deletions
|
@ -78,7 +78,13 @@ func (s *accountDataStatements) InsertAccountData(
|
|||
roomID, dataType string, content json.RawMessage,
|
||||
) (err error) {
|
||||
stmt := sqlutil.TxStmt(txn, s.insertAccountDataStmt)
|
||||
_, err = stmt.ExecContext(ctx, localpart, serverName, roomID, dataType, content)
|
||||
// Empty/nil json.RawMessage is not interpreted as "nil", so use *json.RawMessage
|
||||
// when passing the data to trigger "NOT NULL" constraint
|
||||
var data *json.RawMessage
|
||||
if len(content) > 0 {
|
||||
data = &content
|
||||
}
|
||||
_, err = stmt.ExecContext(ctx, localpart, serverName, roomID, dataType, data)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue