Jet interpreter (Tag.cpp, __call.cpp, __imap*.cpp/h, __smtpsend.cpp/h, __imapemptyfolder.cpp/h - new): assorted parser/tag fixes found across this work - a stray literal-tag-in-comment and backslash-quote parser corruption class, a dangling-pointer fix, a __call.cpp fd leak, IMAP folder-management tags, multi-account/per-host IMAP support, and a smtpsend Message-ID fix. barant.com site (jetc/barant-site/): - A site-wide persistent music player (header band, playlist/queue, stereo FFT EQ, session-persisted state) fed by new library/ ianslibrary/music song-list subpages. - /account split into info/phones/invoices subpages; a full invoicing and Square payment system (create/edit/copy/pay/email invoice); admin invoice management and mail-account management subpages. - /services split into overview/hosting/siptrunking/documents subpages, retiring the old standalone pages. - SIPPHONE.tag: a Jet 2.0 WebRTC softphone tag. - main.css/spa.js/email.js: the SPA loading indicator, the music player band styling, and assorted fixes accumulated alongside this work. qualityiron-site/: the qualityiron.vegas job/contractor/customer/ document management app, ported from its original Jet 1.4 codebase to Jet 2.0 as barant.coms APIServers second multi-tenant site. wcwc/wcwc.jet: the WCWC site Jet source (wcwc.jtc build output not included). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
27 lines
1.2 KiB
C++
27 lines
1.2 KiB
C++
#include "__imapemptyfolder.h"
|
|
#include "Exception.h"
|
|
#include "__imap.h"
|
|
|
|
namespace jet {
|
|
|
|
__imapemptyfolder::__imapemptyfolder(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local) : Tag(in, parentOut, global, parent, local) {
|
|
|
|
coreutils::MString sessionId = resolveKeyword("sessionid");
|
|
if (!global.imapSessionExists(sessionId))
|
|
throw coreutils::Exception("imap sessionid does not exist.", __FILE__, __LINE__, 502);
|
|
|
|
// Unlike __imapdelete (one message - low blast radius even on a
|
|
// wrong default), this permanently destroys an entire folder's
|
|
// contents - no silent "defaults to INBOX" here. A missing/blank
|
|
// folder attribute is refused outright rather than risked.
|
|
if (!keywordDefined("folder"))
|
|
throw coreutils::Exception("imapemptyfolder tag must have folder defined.", __FILE__, __LINE__, 400);
|
|
std::string folder = resolveKeyword("folder").str();
|
|
if (folder.empty())
|
|
throw coreutils::Exception("imapemptyfolder tag must have folder defined.", __FILE__, __LINE__, 400);
|
|
|
|
out = global.getImapSession(sessionId)->emptyFolder(folder);
|
|
}
|
|
|
|
}
|