20 Commits

Author SHA1 Message Date
contact
cd5d76be0e msgstore_fs: fix direct message targets
When fetching messages via draft/chathistory from a conversation
with another user, soju would send the following:

    :sender PRIVMSG sender :hey

instead of

    :sender PRIVMSG recipient :hey

because the file-system message store format doesn't contain the
original PRIVMSG target.

Fix this by doing some guesswork.

git-svn-id: file:///srv/svn/repo/suika/trunk@787 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2022-02-25 20:05:10 +00:00
contact
3dbc059a7b Introduce formatServerTime
It's too easy to forget to convert to UTC.

git-svn-id: file:///srv/svn/repo/suika/trunk@784 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2022-02-16 13:45:09 +00:00
contact
9d44ab9586 msgstore_fs: abort on timeout
git-svn-id: file:///srv/svn/repo/suika/trunk@668 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-11-03 17:21:12 +00:00
contact
58db345425 msgstore: add context to messageStore methods
This allows setting a hard timeout.

git-svn-id: file:///srv/svn/repo/suika/trunk@667 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-11-03 17:21:05 +00:00
contact
21f482684d msgstore: take Network as arg instead of network
The message stores don't need to access the internal network
struct, they just need network metadata such as ID and name.

This can ease moving message stores into a separate package in the
future.

git-svn-id: file:///srv/svn/repo/suika/trunk@666 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-11-03 15:37:01 +00:00
delthas
9cefc64749 Add support for draft/event-playback
git-svn-id: file:///srv/svn/repo/suika/trunk@665 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-11-03 14:17:16 +00:00
contact
abc45dc323 msgstore_fs: rename log dir when network is renamed
git-svn-id: file:///srv/svn/repo/suika/trunk@644 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-15 16:11:04 +00:00
contact
3b153471b8 msgstore_fs: add reference to ZNC
git-svn-id: file:///srv/svn/repo/suika/trunk@642 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-14 18:51:03 +00:00
contact
75c7442d34 msgstore_fs: fix ListTargets error on missing log dir
Initially, before connecting to the network, the log dir will be
empty. Return an empty list of chat history targets in this case.

git-svn-id: file:///srv/svn/repo/suika/trunk@628 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-12 15:36:00 +00:00
alex
700f5d91c6 chathistory: Fix truncated backlog due to timezones
Because msgstore_fs writes logs in localtime, the CHATHISTORY timestamps
(UTC) must be converted to localtime prior to filtering ranges ensure
the right range is sent back to the client.

Prior to this patch, the iteration back from the BEFORE time failed to
load the hours between midnight UTC and midnight localtime in each day's
logged messages. This is because the final time to be considered in a
day's log file (the "start" time) reuses the previous start time's
locale:

    start = time.Date(year, month, day, 0, 0, 0, 0, start.Location()).Add(-1)

By converting the original start and end from the CHATHISTORY commands
to localtime in Load*Time and ListTargets, we ensure we read through
midnight each day.

git-svn-id: file:///srv/svn/repo/suika/trunk@610 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-07 09:57:42 +00:00
contact
3a0dc00117 msgstore_fs: add limit on number of opened files
git-svn-id: file:///srv/svn/repo/suika/trunk@608 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-06 09:41:39 +00:00
hubert
42aec095f7 msgstore_fs: escape "." and ".."
git-svn-id: file:///srv/svn/repo/suika/trunk@591 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-09-19 14:55:12 +00:00
greg
8680f34d28 Slightly relax new log file permissions
Make new log files group-readable by default. To retain the prior
behavior, soju can be started with a umask set to 0077.

git-svn-id: file:///srv/svn/repo/suika/trunk@558 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-06-14 15:58:36 +00:00
contact
522becbe30 Implement CHATHISTORY TARGETS
References: https://github.com/ircv3/ircv3-specifications/pull/450

git-svn-id: file:///srv/svn/repo/suika/trunk@549 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-06-02 18:32:11 +00:00
contact
b893736c9e Check message stores implement expected interfaces
git-svn-id: file:///srv/svn/repo/suika/trunk@517 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-05-18 12:19:34 +00:00
hubert
84c329faff Implement CHATHISTORY BETWEEN
git-svn-id: file:///srv/svn/repo/suika/trunk@516 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-05-18 08:44:10 +00:00
contact
0f0bc90e97 Add more context to chathistory errors
git-svn-id: file:///srv/svn/repo/suika/trunk@515 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-05-11 10:42:12 +00:00
contact
00fbbb9d0d Use BARE for internal message IDs
This allows to have shorter and more future-proof IDs. This also
guarantees the IDs will only use reasonable ASCII characters (no
spaces), removing the need to encode them for PING/PONG tokens.

git-svn-id: file:///srv/svn/repo/suika/trunk@488 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-03-31 15:57:24 +00:00
contact
c1308993f8 Add store-agnostic message ID format
Allow to query the network ID and entity from the message ID regardless
of the underlying store used.

git-svn-id: file:///srv/svn/repo/suika/trunk@440 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-01-04 15:26:30 +00:00
contact
ee6517993f Turn messageStore into an interface
This allows for other implementations that aren't based on a filesystem.

git-svn-id: file:///srv/svn/repo/suika/trunk@439 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-01-04 13:24:00 +00:00