bool f_imap_undelete(const Resource& imap_stream, const String& msg_number, int64_t flags /* = 0 */) { ImapStream *obj = imap_stream.getTyped<ImapStream>(); mail_clearflag_full(obj->m_stream, (char *)msg_number.data(), "\\DELETED", (flags ? flags : NIL)); return true; }
void ImapClient::setFlags(const std::string& aHost, const std::string& aUserName, const std::string& aPassword, const std::string& aMailbox, const unsigned long aMessageNumber, const std::vector<int>& aFlagsVector, const bool aUid) { #include "linkage.c" MAILSTREAM* lSource = getMailStream(aHost, aUserName, aPassword, aMailbox, true); std::string lSequenceNumber; std::stringstream lConverter; lConverter << aMessageNumber; lConverter >> lSequenceNumber; char* lSequence = const_cast<char*>(lSequenceNumber.c_str()); if (aFlagsVector[0] == 1) { mail_setflag_full(lSource, lSequence, "\\Seen", (aUid ? ST_UID : NIL) ); } else { mail_clearflag_full(lSource, lSequence, "\\Seen", (aUid ? ST_UID : NIL ) ); } if (aFlagsVector[1] == 1) { mail_setflag_full(lSource, lSequence, "\\Deleted", (aUid ? ST_UID : NIL)); } else { mail_clearflag_full(lSource, lSequence, "\\Deleted", (aUid ? ST_UID : NIL)); } if (aFlagsVector[2] == 1) { mail_setflag_full(lSource, lSequence, "\\Flagged", (aUid ? ST_UID : NIL)); } else { mail_clearflag_full(lSource, lSequence, "\\Flagged", (aUid ? ST_UID : NIL)); } if (aFlagsVector[3] == 1) { mail_setflag_full(lSource, lSequence, "\\Answered", (aUid ? ST_UID : NIL)); } else { mail_clearflag_full(lSource, lSequence, "\\Answered", (aUid ? ST_UID : NIL)); } if (aFlagsVector[4] == 1) { mail_setflag_full(lSource, lSequence, "\\Draft", (aUid ? ST_UID : NIL)); } else { mail_clearflag_full(lSource, lSequence, "\\Draft", (aUid ? ST_UID : NIL)); } }
static bool HHVM_FUNCTION(imap_clearflag_full, const Resource& imap_stream, const String& sequence, const String& flag, int64_t options /* = 0 */) { ImapStream *obj = imap_stream.getTyped<ImapStream>(); mail_clearflag_full(obj->m_stream, (char *)sequence.data(), (char *)flag.data(), (options ? options : NIL)); return true; }