Back to index

citadel  8.12
Functions
serv_blog.c File Reference
#include "sysdep.h"
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <fcntl.h>
#include <signal.h>
#include <pwd.h>
#include <errno.h>
#include <ctype.h>
#include <sys/types.h>
#include <time.h>
#include <sys/wait.h>
#include <string.h>
#include <limits.h>
#include <libcitadel.h>
#include "citadel.h"
#include "server.h"
#include "citserver.h"
#include "support.h"
#include "config.h"
#include "control.h"
#include "user_ops.h"
#include "database.h"
#include "msgbase.h"
#include "internet_addressing.h"
#include "serv_vcard.h"
#include "citadel_ldap.h"
#include "ctdl_module.h"

Go to the source code of this file.

Functions

int blog_upload_beforesave (struct CtdlMessage *msg)
 CTDL_MODULE_INIT (blog)

Function Documentation

int blog_upload_beforesave ( struct CtdlMessage msg)

Definition at line 65 of file serv_blog.c.

                                                    {

       /* Only run this hook for blog rooms */
       if (CC->room.QRdefaultview != VIEW_BLOG) {
              return(0);
       }

       /* 
        * If the message doesn't have an EUID, give it one.
        */
       if (msg->cm_fields['E'] == NULL)
       {
              char uuid[BLOG_EUIDBUF_SIZE];
              generate_uuid(uuid);
              msg->cm_fields['E'] = strdup(uuid);
       }

       /*
        * We also want to define a maximum length, whether we generated it or not.
        */
       else if (strlen(msg->cm_fields['E']) >= BLOG_EUIDBUF_SIZE) {
              msg->cm_fields['E'][BLOG_EUIDBUF_SIZE-1] = 0;
       }

       /* Now allow the save to complete. */
       return(0);
}

Here is the caller graph for this function:

CTDL_MODULE_INIT ( blog  )

Definition at line 94 of file serv_blog.c.

{
       if (!threading)
       {
              CtdlRegisterMessageHook(blog_upload_beforesave, EVT_BEFORESAVE);
       }
       
       /* return our module id for the Log */
       return "blog";
}

Here is the call graph for this function: