* [sup.git] 01/04: Add sent-save-to hook.
2026-10-31 9:01 [sup.git] branch develop updated (ce4fb685 -> 1cfa015a) Dan Callaghan
@ 2026-10-31 9:01 ` Dan Callaghan
2026-10-31 9:01 ` [sup.git] 02/04: tweak sent-save-to hook doc for clarity Dan Callaghan
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Dan Callaghan @ 2026-10-31 9:01 UTC (permalink / raw)
To: sup-commits
New commit on branch develop:
https://supmua.dev/git/sup/commit/d2315c480a83c8d54a77e4f7e588d66a12541c87.html
commit d2315c480a83c8d54a77e4f7e588d66a12541c87
Author: Edward Z. Yang <ezyang@mit.edu>
AuthorDate: Tue Aug 28 21:40:06 2012 -0400
Add sent-save-to hook.
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
---
lib/sup/modes/edit_message_mode.rb | 13 ++++++++++++-
lib/sup/sent.rb | 9 +++++----
2 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/lib/sup/modes/edit_message_mode.rb b/lib/sup/modes/edit_message_mode.rb
index e69a9bcc..f9de6434 100644
--- a/lib/sup/modes/edit_message_mode.rb
+++ b/lib/sup/modes/edit_message_mode.rb
@@ -80,6 +80,16 @@ Return value:
True if mail has been sent successfully, false otherwise.
EOS
+ HookManager.register "sent-save-to", <<EOS
+Configures where to save sent mail to. If this hook doesn't exist,
+the global sent setting will be used (possibly defaulting to sup://sent)
+Variables:
+ message: RMail::Message instance of the mail to send.
+ account: Account instance matching the From address
+Return value:
+ Source to save mail to, nil to use default
+EOS
+
attr_reader :status
attr_accessor :body, :header
bool_reader :edited
@@ -571,7 +581,8 @@ protected
raise SendmailCommandFailed, "Couldn't execute #{acct.sendmail}" unless $? == 0
end
- SentManager.write_sent_message(date, from_email) { |f| f.puts sanitize_body(m.to_s) }
+ SentManager.write_sent_message(HookManager.run("sent-save-to", :message => m, :account => acct),
+ date, from_email) { |f| f.puts sanitize_body(m.to_s) }
BufferManager.kill_buffer buffer
BufferManager.flash "Message sent!"
true
diff --git a/lib/sup/sent.rb b/lib/sup/sent.rb
index 1c702ceb..640303bb 100644
--- a/lib/sup/sent.rb
+++ b/lib/sup/sent.rb
@@ -24,13 +24,14 @@ class SentManager
@source
end
- def write_sent_message date, from_email, &block
+ def write_sent_message src, date, from_email, &block
::Thread.new do
debug "store the sent message (locking sent source..)"
- @source.synchronize do
- @source.store_message date, from_email, &block
+ use_src = src || @source
+ use_src.synchronize do
+ use_src.store_message date, from_email, &block
end
- PollManager.poll_from @source
+ PollManager.poll_from use_src
end
end
end
^ permalink raw reply related [flat|nested] 5+ messages in thread* [sup.git] 02/04: tweak sent-save-to hook doc for clarity
2026-10-31 9:01 [sup.git] branch develop updated (ce4fb685 -> 1cfa015a) Dan Callaghan
2026-10-31 9:01 ` [sup.git] 01/04: Add sent-save-to hook Dan Callaghan
@ 2026-10-31 9:01 ` Dan Callaghan
2026-10-31 9:01 ` [sup.git] 03/04: sup-sync: handle message updates Dan Callaghan
2026-10-31 9:01 ` [sup.git] 04/04: clean up dead conditional in PollManager#poll_from Dan Callaghan
3 siblings, 0 replies; 5+ messages in thread
From: Dan Callaghan @ 2026-10-31 9:01 UTC (permalink / raw)
To: sup-commits
New commit on branch develop:
https://supmua.dev/git/sup/commit/984879dd7b329a7f9a7aca99357ab566dbe0b087.html
commit 984879dd7b329a7f9a7aca99357ab566dbe0b087
Author: Dan Callaghan <djc@djc.id.au>
AuthorDate: Sat Oct 31 18:52:07 2026 +1100
tweak sent-save-to hook doc for clarity
---
lib/sup/modes/edit_message_mode.rb | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/lib/sup/modes/edit_message_mode.rb b/lib/sup/modes/edit_message_mode.rb
index f9de6434..01661731 100644
--- a/lib/sup/modes/edit_message_mode.rb
+++ b/lib/sup/modes/edit_message_mode.rb
@@ -81,13 +81,13 @@ Return value:
EOS
HookManager.register "sent-save-to", <<EOS
-Configures where to save sent mail to. If this hook doesn't exist,
-the global sent setting will be used (possibly defaulting to sup://sent)
+Selects where to save sent mail to. If this hook doesn't exist, the
+"sent_source" config will be used (possibly defaulting to sup://sent).
Variables:
- message: RMail::Message instance of the mail to send.
- account: Account instance matching the From address
+ message: RMail::Message instance of the mail which has been sent.
+ account: Account instance matching the From address.
Return value:
- Source to save mail to, nil to use default
+ Source to save the sent mail to, or nil to use the default.
EOS
attr_reader :status
^ permalink raw reply related [flat|nested] 5+ messages in thread* [sup.git] 03/04: sup-sync: handle message updates
2026-10-31 9:01 [sup.git] branch develop updated (ce4fb685 -> 1cfa015a) Dan Callaghan
2026-10-31 9:01 ` [sup.git] 01/04: Add sent-save-to hook Dan Callaghan
2026-10-31 9:01 ` [sup.git] 02/04: tweak sent-save-to hook doc for clarity Dan Callaghan
@ 2026-10-31 9:01 ` Dan Callaghan
2026-10-31 9:01 ` [sup.git] 04/04: clean up dead conditional in PollManager#poll_from Dan Callaghan
3 siblings, 0 replies; 5+ messages in thread
From: Dan Callaghan @ 2026-10-31 9:01 UTC (permalink / raw)
To: sup-commits
New commit on branch develop:
https://supmua.dev/git/sup/commit/8335e911073a02f2aedb4790540f70d6df81fb58.html
commit 8335e911073a02f2aedb4790540f70d6df81fb58
Author: Dan Callaghan <djc@djc.id.au>
AuthorDate: Sat Oct 31 19:13:20 2026 +1100
sup-sync: handle message updates
Fixes #169.
---
bin/sup-sync | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/bin/sup-sync b/bin/sup-sync
index ee939332..7238442e 100755
--- a/bin/sup-sync
+++ b/bin/sup-sync
@@ -126,7 +126,7 @@ begin
if action == :delete
num_deleted += 1
puts "Deleting #{m.id}" if opts[:verbose]
- elsif action == :add
+ elsif action == :add || action == :update
seen[m.id] = true
## tweak source labels according to commandline arguments if necessary
@@ -174,7 +174,6 @@ begin
puts "Changing flags for #{source}##{m.source_info} from #{old_m.labels} to #{m.labels}" if opts[:verbose]
num_updated += 1
end
- else fail "sup-sync cannot handle :update's"
end
if Time.now - last_info_time > PROGRESS_UPDATE_INTERVAL
^ permalink raw reply related [flat|nested] 5+ messages in thread* [sup.git] 04/04: clean up dead conditional in PollManager#poll_from
2026-10-31 9:01 [sup.git] branch develop updated (ce4fb685 -> 1cfa015a) Dan Callaghan
` (2 preceding siblings ...)
2026-10-31 9:01 ` [sup.git] 03/04: sup-sync: handle message updates Dan Callaghan
@ 2026-10-31 9:01 ` Dan Callaghan
3 siblings, 0 replies; 5+ messages in thread
From: Dan Callaghan @ 2026-10-31 9:01 UTC (permalink / raw)
To: sup-commits
New commit on branch develop:
https://supmua.dev/git/sup/commit/1cfa015ac59dda1303cd77382ca7548b397c6952.html
commit 1cfa015ac59dda1303cd77382ca7548b397c6952
Author: Dan Callaghan <djc@djc.id.au>
AuthorDate: Sat Oct 31 19:35:43 2026 +1100
clean up dead conditional in PollManager#poll_from
The scenario this comment and conditional was originally trying to
address in commit 5688027 was solved by the introduction of
handle_updated_update. We can just drop it.
Fixes #170.
---
lib/sup/poll.rb | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/lib/sup/poll.rb b/lib/sup/poll.rb
index a07b2011..f4a45d48 100644
--- a/lib/sup/poll.rb
+++ b/lib/sup/poll.rb
@@ -219,12 +219,9 @@ EOS
Index.sync_message m, true
end
- ## We need to add or unhide the message when it either did not exist
- ## before at all or when it was updated. We do *not* add/unhide when
- ## the same message was found at a different location
if old_m
UpdateManager.relay self, :updated, m
- elsif !old_m or not old_m.locations.member? m.location
+ else
UpdateManager.relay self, :added, m
end
when :delete
^ permalink raw reply related [flat|nested] 5+ messages in thread