#include "user_ops.h"
#include "database.h"
#include "msgbase.h"
+#include "room_ops.h"
#include "internet_addressing.h"
#include "serv_vcard.h"
#include "citadel_ldap.h"
vcard_extract_internet_addresses(msg, vcard_directory_add_user);
}
- CtdlFreeMessage(msg);
+ CM_Free(msg);
}
* function accordingly (delete the user's existing vCard in the config room
* and in the global address book).
*/
-int vcard_upload_beforesave(struct CtdlMessage *msg) {
+int vcard_upload_beforesave(struct CtdlMessage *msg, recptypes *recp) {
struct CitContext *CCC = CC;
char *s;
char buf[SIZ];
if (CM_IsEmpty(msg, eMesageText)) return(0);
- mime_parser(msg->cm_fields[eMesageText],
- NULL,
- *vcard_extract_vcard,
- NULL, NULL,
- &v, /* user data ptr - put the vcard here */
- 0
+ mime_parser(CM_RANGE(msg, eMesageText),
+ *vcard_extract_vcard,
+ NULL, NULL,
+ &v, /* user data ptr - put the vcard here */
+ 0
);
if (v == NULL) return(0); /* no vCards were found in this message */
* function accordingly (copy the vCard from the config room to the global
* address book).
*/
-int vcard_upload_aftersave(struct CtdlMessage *msg) {
+int vcard_upload_aftersave(struct CtdlMessage *msg, recptypes *recp) {
struct CitContext *CCC = CC;
char *ptr;
int linelen;
if (msg == NULL) return vcard_new();
v = vcard_load(msg->cm_fields[eMesageText]);
- CtdlFreeMessage(msg);
+ CM_Free(msg);
return v;
}
CM_SetField(msg, eSpecialField, HKEY("CANCEL"));
CtdlSubmitMsg(msg, NULL, ADDRESS_BOOK_ROOM, QP_EADDR);
- CtdlFreeMessage(msg);
+ CM_Free(msg);
}
if (ptr != NULL) ++ptr;
}
-EOH: CtdlFreeMessage(msg);
+EOH: CM_Free(msg);
}
msg = CtdlFetchMessage(msgnum, 1);
if (msg == NULL) return;
- mime_parser(msg->cm_fields[eMesageText],
- NULL,
- *dvca_mime_callback, /* callback function */
- NULL, NULL,
- NULL, /* user data */
- 0
- );
- CtdlFreeMessage(msg);
+ mime_parser(CM_RANGE(msg, eMesageText),
+ *dvca_mime_callback, /* callback function */
+ NULL, NULL,
+ NULL, /* user data */
+ 0
+ );
+ CM_Free(msg);
}
if (strncasecmp(cmdbuf, "GET ", 4)==0)
{
- struct recptypes *rcpt;
+ recptypes *rcpt;
char *argbuf = &cmdbuf[4];
extract_token(internet_addr, argbuf, 0, '|', sizeof internet_addr);
msg = CtdlFetchMessage(msgnum, 1);
if (msg == NULL) return;
v = vcard_load(msg->cm_fields[eMesageText]);
- CtdlFreeMessage(msg);
+ CM_Free(msg);
i = 0;
while (value = vcard_get_prop(v, "email", 1, i++, 0), value != NULL) {
syslog(LOG_DEBUG, "Adding contact: %s", recipient);
CtdlSubmitMsg(vmsg, NULL, aptr->roomname, QP_EADDR);
- CtdlFreeMessage(vmsg);
+ CM_Free(vmsg);
}
}