whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [whimsy] branch mod-gui updated: Not used
Date Wed, 13 Feb 2019 19:11:56 GMT
This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch mod-gui
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/mod-gui by this push:
     new 952b68b  Not used
952b68b is described below

commit 952b68bee4170e4d5b25acb85d92e1f4871edaef
Author: Sebb <sebb@apache.org>
AuthorDate: Wed Feb 13 19:11:50 2019 +0000

    Not used
---
 www/moderation/desk/models/message.rb | 65 -----------------------------------
 1 file changed, 65 deletions(-)

diff --git a/www/moderation/desk/models/message.rb b/www/moderation/desk/models/message.rb
index cb73e18..a42caf5 100644
--- a/www/moderation/desk/models/message.rb
+++ b/www/moderation/desk/models/message.rb
@@ -122,36 +122,6 @@ class Message
   end
 
   #
-  # attachment operations: update, replace, delete
-  #
-
-  def update_attachment name, values
-    attachment = find(name)
-    if attachment
-      attachment.headers.merge! values
-      write_headers
-    end
-  end
-
-  def replace_attachment name, values
-    attachment = find(name)
-    if attachment
-      index = @headers[:attachments].find_index(attachment.headers)
-      @headers[:attachments][index, 1] = Array(values)
-      write_headers
-    end
-  end
-
-  def delete_attachment name
-    attachment = find(name)
-    if attachment
-      @headers[:attachments].delete attachment.headers
-      @headers[:status] = :deleted if @headers[:attachments].empty?
-      write_headers
-    end
-  end
-
-  #
   # write updated headers to disk
   #
   def write_headers
@@ -166,41 +136,6 @@ class Message
   end
 
   #
-  # write one or more attachments to directory containing an svn checkout
-  #
-  def write_svn(repos, filename, *attachments)
-    # drop all nil and empty values
-    attachments = attachments.flatten.reject {|name| name.to_s.empty?}
-
-    # if last argument is a Hash, treat it as name/value pairs
-    attachments += attachments.pop.to_a if Hash === attachments.last
-
-    if attachments.flatten.length == 1
-      ext = File.extname(attachments.first).downcase.untaint
-      find(attachments.first).write_svn(repos, filename + ext)
-    else
-      # validate filename
-      unless filename =~ /\A[a-zA-Z][-.\w]+\z/
-        raise IOError.new("invalid filename: #{filename}")
-      end
-
-      # create directory, if necessary
-      dest = File.join(repos, filename).untaint
-      unless File.exist? dest
-        Dir.mkdir dest 
-        Kernel.system 'svn', 'add', dest
-      end
-
-      # write out selected attachment
-      attachments.each do |attachment, basename|
-        find(attachment).write_svn(repos, filename, basename)
-      end
-
-      dest
-    end
-  end
-
-  #
   # Construct a reply message, and in the process merge the email
   # address from the original message (from, to, cc) with any additional
   # address provided on the call (to, cc, bcc).  Remove any duplicates


Mime
View raw message