Revert "Generate UUID in blog posts to be used in permalinks"
[citadel.git] / citadel / modules / blog / serv_blog.c
index 5459898f759095115fb06af6877b9d322d2efbb9..6997a057e48548fd2597b7691900ce616318d4dd 100644 (file)
@@ -1,11 +1,11 @@
 /*
  * Support for blog rooms
  *
- * Copyright (c) 1999-2011 by the citadel.org team
+ * Copyright (c) 1999-2010 by the citadel.org team
  *
- * This program is open source software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 3 of the License, or
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
@@ -15,7 +15,7 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 #include "sysdep.h"
 #include "ctdl_module.h"
 
 /*
- * Pre-save hook for saving a message in a blog room.
- * (Do we want to only do this for top-level messages?)
+ * sd sdhfksdjhkjsdfhk jsdhfkjsdfhkjsd hkfjhsdkjfhsdkjfhksdjfhsd
  */
 int blog_upload_beforesave(struct CtdlMessage *msg) {
+       char buf[SIZ];
 
        /* Only run this hook for blog rooms */
        if (CC->room.QRdefaultview != VIEW_BLOG) {
@@ -72,11 +72,10 @@ int blog_upload_beforesave(struct CtdlMessage *msg) {
        /* 
         * If the message doesn't have an EUID, give it one.
         */
-       if (msg->cm_fields['E'] == NULL)
+       if (msg->cm_fields['E'] != NULL)
        {
-               char uuid[37];
-               generate_uuid(uuid);
-               msg->cm_fields['E'] = strdup(uuid);
+               generate_uuid(buf);
+               msg->cm_fields['E'] = strdup(buf);
        }
 
        /* Now allow the save to complete. */