correct exchange of from and to
[org.ibex.mail.git] / src / org / ibex / mail / Message.java
index 66c4188..c9fc2ae 100644 (file)
@@ -31,8 +31,8 @@ public class Message extends MIME.Part {
     // Envelope //////////////////////////////////////////////////////////////////////////////
 
     public final Envelope    envelope;
-    public static class Envelope {
-        public Envelope(Address to, Address from, Date arrival) { this.to = to; this.from = from; this.arrival = arrival; }
+    public static class Envelope extends org.ibex.js.JSReflection {
+        public Envelope(Address from, Address to, Date arrival) { this.to = to; this.from = from; this.arrival = arrival; }
         public final Date arrival;
         public final Address to;
         public final Address from;
@@ -40,7 +40,7 @@ public class Message extends MIME.Part {
             if (e.from != null && e.to != null) return e;
             Address to   = e.to   == null ? Address.parse(h.get("X-org.ibex.mail.headers.envelope.To"))   : e.to;
             Address from = e.from == null ? Address.parse(h.get("X-org.ibex.mail.headers.envelope.From")) : e.from;
-            return new Envelope(to, from, e.arrival);
+            return new Envelope(from, to, e.arrival);
         }
     }