A FIXED -> FIXED transition happens, e.g., here:
https://todo.sr.ht/~sircmpwn/meta.sr.ht/46#event-47525
because I fucked up a link and listed this one twice,
and Drew opened each link first, then closed them,
hence marking the ticket as FIXED twice
With this patch, we just do nothing if there's nothing to do
To reproduce, the setup:
* run todo.sr.ht-lmtp,
listen on sock=127.0.0.1:2525,
with posting-domain=todo.nabijaczleweli.xyz
* register users:
+ ~nabijaczleweli <nabijaczleweli/srht/test@nabijaczleweli.xyz>
+ ~nabijaczleweli2 <nabijaczleweli/srht/test2@nabijaczleweli.xyz>
* create tracker "~nabijaczleweli/test", potentially unsubscribe
* do not subscribe ~nabijaczleweli2 to that tracker
Now, run
-- >8 --
$ telnet 127.0.0.1 2525
ehlo owo
mail from:<nabijaczleweli/srht/test2@nabijaczleweli.xyz>
rcpt to:<~nabijaczleweli/test@todo.nabijaczleweli.xyz>
data
From: nabijaczleweli/srht/test2@nabijaczleweli.xyz
To: ~nabijaczleweli/test@todo.nabijaczleweli.xyz
Subject: Repro
This will not be delivered to nabijaczleweli2
.
quit
-- >8 --
If you didn't unsubscribe, ~nabijaczleweli will get the e-mail;
either way, ~nabijaczleweli2 won't receive it.
This goes against the intent of 6599be5371
This happens because in submit_ticket() tracker.subscriptions is either
empty or contains just ~nabijaczleweli; concatenating it with
ticket.subscriptions allows picking up the potential new sub created by
get_or_create_subscription().
With this patch, delivering that same mail will also notify
~nabijaczleweli2.
This fixes the problem described in
https://lists.sr.ht/~sircmpwn/sr.ht-dev/%3C20200714151756.gxmowmpohmtps76h@tarta.local.nabijaczleweli.xyz%3E
Makes the following changes to the Event type:
* make `user` and `ticket` nullable since some events require it
* add `by_user` and `from_ticket` to enable mentions
* remove `assinged_user` which is no longer used
Ticket: https://todo.sr.ht/~sircmpwn/todo.sr.ht/156
Qualified ticket mentions which include a username, such as
~user/repo#123 should not be matched by the user mention regex pattern.
This caused the usernames in the ticket mentions to be linked.
Fixed by changing the user mention pattern to not match if the username
is followed by a slash.