Commit Graph

32 Commits

Author SHA1 Message Date
Aine
8d6c4aeafe big refactoring 2022-11-25 23:33:38 +02:00
Aine
21772d7360 mailbox activation, closes #52 2022-11-21 15:37:44 +02:00
Aine
3ef6d2698e optimize ban checks 2022-11-18 09:22:18 +02:00
Aine
4dd09dacb4 move migration to the postmoogle inital room sync 2022-10-17 19:01:21 +03:00
Aine
590182c272 do not return error on empty account data, fix room account data cache key, update deps, fixes #37 2022-10-12 13:53:30 +03:00
Aine
104e948b9c remove migrations 2022-08-31 10:33:13 +03:00
Aine
627e090afd rename account data keys, rearrange code 2022-08-30 14:42:07 +03:00
Aine
5ed3a53223 diff bot and room settings 2022-08-30 14:37:19 +03:00
Aine
f97ebb604a manage users in runtime, closes #16 2022-08-29 21:41:14 +03:00
Aine
2dcba843cc add 'nofiles' option, refactored bot.Send(); fixes #2 2022-08-26 16:11:08 +03:00
Aine
42c9e15619 add 'nothreads' option, fixes #4 2022-08-26 16:00:37 +03:00
Aine
41a52c1eca add 'nohtml' option, fixes #5 2022-08-26 15:56:25 +03:00
Aine
0a5bc5d989 refactor rooms/roomsmu to sync.Map 2022-08-25 22:38:45 +03:00
Aine
b0c274491f refactor to context, remove sentry spans 2022-08-25 22:31:12 +03:00
Aine
f9cf94c914 threads 2022-08-24 21:28:30 +03:00
Slavi Pantaleev
ed5ff6456a Ensure settings map is always initialized
Without this, if settings are not found in account data (`M_NOT_FOUND`),
we won't initialize the map and we'll panic later:

> assignment to entry in nil map

Breaking settings for all new rooms is definitely not what we inteded.

Likely a regression since 726bc95c26, but related to fcac0a202d as
well.
2022-08-24 12:22:19 +03:00
Slavi Pantaleev
26edcdadbc Use string constants for options, not magic strings
This also adds `Mailbox()` and `Owner()` getters for completeness.

Wording has been changed a bit to avoid saying "that room". It sounds
better if it's "this room" or just "the room".
2022-08-24 10:56:47 +03:00
Slavi Pantaleev
e86a9ed952 Rename variable 2022-08-24 10:33:19 +03:00
Slavi Pantaleev
6103164881 Fix linting error 2022-08-24 10:31:42 +03:00
Slavi Pantaleev
16ce4314b9 Sanitize settings on Get() and add convenience getters
Sanitizing options on Get() ensures that when someone asks
for a given option which may not be defined (`nosubject`, `nosender`),
we'll return a valid value (`'true'` or `'false'`) and not `''` (empty
string, undefined).

This way, users do not need to wonder if "nosender is not set" is
handled like "true" or "false" or in some 3rd way. They also don't need
to think about "how to unset this setting, now that I've set it to something".
Options will appear to have a default sanitized value no matter if
they've explicitly been set or not.

The `NoSender()` and `NoSubject()` getters are just there for
convenience, so that we won't need to do casting in other places.
2022-08-24 10:16:28 +03:00
Aine
85fc06cfce lint; rearrange code 2022-08-23 22:12:11 +03:00
Aine
e5e9be528b refactor options to be more generic 2022-08-23 21:58:05 +03:00
Aine
9eec8738f9 move syncRooms 2022-08-23 19:25:45 +03:00
Aine
81abe8c785 unoptimal refactoring 2022-08-23 19:23:15 +03:00
Slavi Pantaleev
9f3aa3dd68 Add ability to hide sender's email address (hide-sender-address setting)
The configuration setting is called `Hide*` instead of `Show*`, because
it's backward compatible with existing configuration settings.

This is useful for when you setup an email forwarding inbox and you're
always sending to it through the same email address. In that case, you
don't need to see the email address in each Matrix message.

In the future, another similar `bool` setting (`hide-subject`) will land,
which controls whether the email's subject is shown in the final message
or not. That setting can make use of most of the same setup (all of
`handleBooleanConfigurationKey`).
2022-08-23 18:21:23 +03:00
Aine
518ec97160 lint fix 2022-08-23 17:54:01 +03:00
Slavi Pantaleev
726bc95c26 Suppress M_NOT_FOUND error when fetching settings
.. and ensure that getSettings() always returns either a default empty
settings object or an error.
2022-08-23 16:30:19 +03:00
Slavi Pantaleev
fcac0a202d Make sure getSettings() always returns settings or error 2022-08-23 13:04:54 +00:00
Aine
0decd4fad6 add noowner and federation 2022-08-22 22:08:32 +03:00
Aine
e6d5e81efe bugfixes; email parsing; send emails into matrix rooms; e2e tests 2022-08-22 12:28:29 +03:00
Aine
c746c91dbb account data only; integrate smtp server; logging 2022-08-21 23:00:20 +03:00
Aine
c4b7a16e21 wip 2022-08-21 18:41:35 +03:00