Commit 1cd75164 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(add_text_in_conf): Use current_time instead of calling time().

(do_create_text): Likewise.
(add_recipient): Likewise.
(add_footnote): Likewise.
(add_comment): Likewise.
(create_text_add_miscs): Removed the now argument.  All callers
	updated.  User current_time instead of now.
parent 8befbc4f
/*
* $Id: text.c,v 0.63 1999/05/12 13:25:38 byers Exp $
* $Id: text.c,v 0.64 1999/05/16 21:47:36 ceder Exp $
* Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -34,7 +34,7 @@
#endif
static const char *
rcsid = "$Id: text.c,v 0.63 1999/05/12 13:25:38 byers Exp $";
rcsid = "$Id: text.c,v 0.64 1999/05/16 21:47:36 ceder Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -71,6 +71,7 @@ USE(rcsid);
#include "aux-items.h"
#include "internal-services.h"
#include "local-to-global.h"
#include "server-time.h"
/*
......@@ -102,7 +103,7 @@ add_text_in_conf(Conference * conf_c,
{
Local_text_no res;
time( & conf_c->last_written );
conf_c->last_written = current_time;
/* Add number last on the text_list */
res = l2g_first_appendable_key(&conf_c->texts);
......@@ -2178,8 +2179,7 @@ create_text_add_aux(Text_stat *t_stat,
static Success
create_text_add_miscs(Text_no new_text,
int no_of_misc,
Misc_info * misc,
time_t now)
Misc_info * misc)
{
int i;
Conference *conf_c;
......@@ -2207,7 +2207,7 @@ create_text_add_miscs(Text_no new_text,
if ( do_add_recpt(new_text, NULL, misc[ i ].datum.recipient) != OK)
return FAILURE;
GET_C_STAT(conf_c, misc[i].datum.recipient, FAILURE);
conf_c->last_written = now;
conf_c->last_written = current_time;
break;
case cc_recpt:
......@@ -2215,7 +2215,7 @@ create_text_add_miscs(Text_no new_text,
misc[ i ].datum.cc_recipient) !=OK )
return FAILURE;
GET_C_STAT(conf_c, misc[i].datum.cc_recipient, FAILURE);
conf_c->last_written = now;
conf_c->last_written = current_time;
break;
case bcc_recpt:
......@@ -2223,7 +2223,7 @@ create_text_add_miscs(Text_no new_text,
misc[ i ].datum.bcc_recipient) !=OK )
return FAILURE;
GET_C_STAT(conf_c, misc[i].datum.bcc_recipient, FAILURE);
conf_c->last_written = now;
conf_c->last_written = current_time;
break;
case loc_no: /* Ignore loc_no. */
......@@ -2517,7 +2517,6 @@ do_create_text(const String message,
{
Text_no text;
Text_stat * t_stat;
time_t now;
CHK_LOGIN(0);
......@@ -2539,13 +2538,9 @@ do_create_text(const String message,
return 0;
}
/* Get creation time */
now = time(NULL);
/* Check all misc-items and aux-items */
prepare_aux_item_list(aux, anonymous?0:ACTPERS, now);
prepare_aux_item_list(aux, anonymous?0:ACTPERS);
if ( create_text_check_misc(&no_of_misc, misc, anonymous) != OK
|| text_stat_check_add_aux_item_list(NULL, aux,
ACTPERS, TRUE) != OK
......@@ -2565,11 +2560,11 @@ do_create_text(const String message,
*ret_stat = t_stat;
t_stat->author = anonymous?0:ACTPERS;
t_stat->creation_time = now;
t_stat->creation_time = current_time;
t_stat->no_of_lines = count_lines( message );
t_stat->no_of_chars = s_strlen( message );
if ( create_text_add_miscs(text, no_of_misc, misc, now) != OK )
if ( create_text_add_miscs(text, no_of_misc, misc) != OK )
{
kom_log("ERROR: create_text(): can't add miscs.\n");
return 0;
......@@ -2867,7 +2862,7 @@ add_recipient( Text_no text_no,
if ( t_stat->author != ACTPERS )
ADD_MISC(t_stat, sent_by, sender, ACTPERS);
ADD_MISC(t_stat, sent_at, sent_at, time(NULL));
ADD_MISC(t_stat, sent_at, sent_at, current_time);
#endif
mark_text_as_changed( text_no );
......@@ -2947,7 +2942,7 @@ add_recipient( Text_no text_no,
if ( t_stat->author != ACTPERS )
ADD_MISC(t_stat, sent_by, sender, ACTPERS);
ADD_MISC(t_stat, sent_at, sent_at, time(NULL));
ADD_MISC(t_stat, sent_at, sent_at, current_time);
mark_text_as_changed( text_no );
send_async_add_recipient( text_no, t_stat, conf_no, type );
......@@ -3070,7 +3065,7 @@ add_comment(Text_no comment,
if ( child_s->author != ACTPERS )
ADD_MISC(child_s, sent_by, sender, ACTPERS);
ADD_MISC(child_s, sent_at, sent_at, time(NULL));
ADD_MISC(child_s, sent_at, sent_at, current_time);
mark_text_as_changed (comment);
return OK;
......@@ -3179,7 +3174,7 @@ add_footnote( Text_no footnote,
if ( do_add_footnote(footnote, footnote_to) != OK)
return FAILURE;
ADD_MISC(text_s, sent_at, sent_at, time(NULL));
ADD_MISC(text_s, sent_at, sent_at, current_time);
mark_text_as_changed( footnote );
return OK;
......@@ -3361,7 +3356,7 @@ modify_text_info(Text_no text,
/* Check if we may delete and add the items */
prepare_aux_item_list(aux, ACTPERS, time(NULL));
prepare_aux_item_list(aux, ACTPERS);
if (check_delete_aux_item_list(items_to_delete,&text_s->aux_item_list)!=OK)
return FAILURE;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment