Commit Graph

8 Commits

Author SHA1 Message Date
Simon Ser
1b8d8d08c9 db_sqlite: fix realname not fetched in ListUsers
This fixes per-user realname not being used on bouncer startup.
2021-10-05 11:10:48 +02:00
Simon Ser
fce86b0f0d db_sqlite: switch to sql.Named
This allows us to avoid mixing up arguments.
2021-09-27 16:54:06 +02:00
Hubert Hirtz
6b9c99821a Fix DeliveryReceipt not being cleaned up 2021-09-21 18:19:05 +02:00
Hubert Hirtz
bc83d3a3ba Use NULL-tolerant comparison for DeliveryReceipts
Since NULL = NULL is always FALSE, this query needs to use IS instead.
This should fix the flood of DeliveryReceipts in the DB.

See https://www.sqlite.org/lang_expr.html

> The IS and IS NOT operators work like = and != except when one or both
> of the operands are NULL. In this case, if both operands are NULL,
> then the IS operator evaluates to 1 (true) and the IS NOT operator
> evaluates to 0 (false). If one operand is NULL and the other is not,
> then the IS operator evaluates to 0 (false) and the IS NOT operator is
> 1 (true). It is not possible for an IS or IS NOT expression to
> evaluate to NULL.
2021-09-14 18:38:58 +02:00
Hubert Hirtz
4dce5a91c9 Explicitly close connection to SQLite on failed upgrade 2021-09-13 17:14:04 +02:00
Simon Ser
a14f646135 Add per-user realname setting
This allows users to set a default realname used if the per-network
realname isn't set.

A new "user update" command is introduced and can be extended to edit
other user properties and other users in the future.
2021-06-25 20:33:13 +02:00
Simon Ser
7d648f702e Allow networks to be disabled 2021-05-26 10:51:02 +02:00
Drew DeVault
61b68d6dfb db: refactor into interface
This refactors the SQLite-specific bits into db_sqlite.go. A future
patch will add PostgreSQL support.
2021-05-25 16:35:39 +02:00