db->search_op(jcr, "MetaAttachment.AttachmentName", Name, esc.handle(), tmp.handle());
append_AND_OR_filter(and_or, where, tmp.c_str());
}
+
+ if (isInline >= 0) {
+ Mmsg(tmp, " MetaAttachment.AttachmentIsInline = %d", isInline);
+ append_filter(where, tmp.c_str());
+ }
+
+ if (ContentType[0]) {
+ db_escape_string(jcr, jcr->db, esc.c_str(), ContentType, strlen(ContentType));
+ Mmsg(tmp, " MetaAttachment.AttachmentContentType = '%s'", esc.c_str());
+ append_filter(where, tmp.c_str());
+ }
}
if (Owner[0]) {
int HasAttachment;
int isDraft;
int isRead;
+ int isInline;
uint64_t offset;
uint32_t limit;
int order;
char Plugin[MAX_NAME_LENGTH];
char Name[MAX_SEARCH_LENGTH];
char FolderName[MAX_SEARCH_LENGTH];
+ char ContentType[MAX_SEARCH_LENGTH];
char errmsg[MAX_NAME_LENGTH];
META_DBR(): MinSize(-1), MaxSize(-1), HasAttachment(-1),
- isDraft(-1), isRead(-1), offset(0), limit(512), order(0), orderby(0), all(false)
+ isDraft(-1), isRead(-1), isInline(-1), offset(0), limit(512),
+ order(0), orderby(0), all(false)
{
JobIds = NULL;
*Id = *Tenant = *Owner = 0;
*ClientName = *From = *To = *Cc = *Subject = *Tags = 0;
*BodyPreview = *Type = *ConversationId = *Category = 0;
*FolderName = *Name = *MinTime = *MaxTime = *Plugin = 0;
+ *ContentType = 0;
*errmsg = 0;
};
~META_DBR() {};
"\t [from=<str> to=<str> cc=<str> tags=<str> subject=<str> bodypreview=<str> all=<str>\n"
"\t minsize=<int> maxsize=<int> importance=<str> isread=<0|1> isdraft=<0|1> categories=<str>\n"
"\t conversationid=<str> hasattachment=<0|1> starttime=<time> endtime=<time>\n"
- "\t emailid=<str> foldername=<str>]\n"
+ "\t emailid=<str> foldername=<str> isinline=<0|1> contenttype=<str>]\n"
), false},
{ NT_("llist"), llist_cmd, _("Full or long list like list command"),
} else if (strcasecmp(ua->argk[j], NT_("from")) == 0) {
bstrncpy(meta_r.From, ua->argv[j], sizeof(meta_r.From));
+ } else if (strcasecmp(ua->argk[j], NT_("contenttype")) == 0) {
+ bstrncpy(meta_r.ContentType, ua->argv[j], sizeof(meta_r.ContentType));
+
} else if (strcasecmp(ua->argk[j], NT_("name")) == 0) {
bstrncpy(meta_r.Name, ua->argv[j], sizeof(meta_r.Name));
} else if (strcasecmp(ua->argk[j], NT_("isread")) == 0) {
meta_r.isRead = str_to_uint64(ua->argv[j]);
+ } else if (strcasecmp(ua->argk[j], NT_("isinline")) == 0) {
+ meta_r.isInline = str_to_uint64(ua->argv[j]);
+
} else if (strcasecmp(ua->argk[j], NT_("isdraft")) == 0) {
meta_r.isDraft = str_to_uint64(ua->argv[j]);