Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions lib/sup/draft.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@ def write_draft
PollManager.poll_from @source
end

# This works for all sources, not only sup://drafts
def discard m
raise ArgumentError, "not a draft: source id #{m.source.id.inspect}, should be #{DraftManager.source_id.inspect} for #{m.id.inspect}" unless m.source.id.to_i == DraftManager.source_id
Index.delete m.id
File.delete @source.fn_for_offset(m.source_info) rescue Errono::ENOENT
m.remove_label :draft
UpdateManager.relay self, :single_message_deleted, m
end
end
Expand Down
4 changes: 4 additions & 0 deletions lib/sup/maildir.rb
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,10 @@ def valid? id
File.exists? File.join(@dir, id)
end

def fn_for_offset offset
return File.join(@dir, offset)
end

private

def new_maildir_basefn
Expand Down