mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-12-02 12:13:54 +01:00
@@ -82,10 +82,11 @@ class BodyStructure(object):
|
|||||||
params = dict(pnum=pnum, params=definition[2], cid=definition[3],
|
params = dict(pnum=pnum, params=definition[2], cid=definition[3],
|
||||||
description=definition[4], encoding=definition[5],
|
description=definition[4], encoding=definition[5],
|
||||||
size=definition[6])
|
size=definition[6])
|
||||||
|
mtype = definition[0].lower()
|
||||||
subtype = definition[1].lower()
|
subtype = definition[1].lower()
|
||||||
mtype = "%s/%s" % (definition[0].lower(), subtype)
|
ftype = "%s/%s" % (definition[0].lower(), subtype)
|
||||||
if mtype in ("text/plain", "text/html"):
|
if ftype in ("text/plain", "text/html"):
|
||||||
if not self.contents.has_key(mtype):
|
if not self.contents.has_key(ftype):
|
||||||
self.contents[subtype] = params
|
self.contents[subtype] = params
|
||||||
return
|
return
|
||||||
elif multisubtype in ["related"]:
|
elif multisubtype in ["related"]:
|
||||||
@@ -93,8 +94,13 @@ class BodyStructure(object):
|
|||||||
return
|
return
|
||||||
|
|
||||||
if len(definition) > 7:
|
if len(definition) > 7:
|
||||||
params.update(md5=definition[7], disposition=definition[8],
|
extensions = ["md5", "disposition", "language", "location"]
|
||||||
lang=definition[9], location=definition[10])
|
if mtype == "text":
|
||||||
|
extensions = ["textlines"] + extensions
|
||||||
|
elif ftype == "message/rfc822":
|
||||||
|
extensions = ["envelopestruct", "bodystruct", "textlines"] + extensions
|
||||||
|
for idx, value in enumerate(definition[7:]):
|
||||||
|
params[extensions[idx]] = value
|
||||||
self.attachments += [params]
|
self.attachments += [params]
|
||||||
|
|
||||||
def load_from_definition(self, definition, multisubtype=None):
|
def load_from_definition(self, definition, multisubtype=None):
|
||||||
|
|||||||
@@ -111,8 +111,7 @@ Webmail.prototype = {
|
|||||||
$.proxy(this.sendmail, this));
|
$.proxy(this.sendmail, this));
|
||||||
|
|
||||||
$(document).on("click", "#attachments", $.proxy(function(e) {
|
$(document).on("click", "#attachments", $.proxy(function(e) {
|
||||||
var $div = $(e.target).parent();
|
modalbox(e, undefined, $("#attachments").attr("name"),
|
||||||
modalbox(e, undefined, $div.attr("name"),
|
|
||||||
$.proxy(this.attachments_init, this));
|
$.proxy(this.attachments_init, this));
|
||||||
}, this));
|
}, this));
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user