Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv10744/src
Modified Files:
mod-memoserv.c
Log Message:
actually mark memos as read (and record status in database)
Index: mod-memoserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/mod-memoserv.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** mod-memoserv.c 2 Dec 2003 19:47:14 -0000 1.9
--- mod-memoserv.c 31 Dec 2003 15:59:54 -0000 1.10
***************
*** 57,60 ****
--- 57,61 ----
#define KEY_FROM "from"
#define KEY_MESSAGE "msg"
+ #define KEY_READ "read"
#define MSMSG_CANNOT_SEND "You cannot send to account $b%s$b."
***************
*** 294,297 ****
--- 295,299 ----
reply(MSMSG_MEMO_HEAD, memoid, memo->sender->handle->handle, posted);
reply(MSMSG_MEMO_BODY, memo->message);
+ memo->is_read = 1;
return 1;
}
***************
*** 456,459 ****
--- 458,462 ----
struct handle_info *sender, *recipient;
struct record_data *hir;
+ struct memo *memo;
dict_iterator_t it;
time_t sent;
***************
*** 493,497 ****
}
! add_memo(sent, memoserv_get_account(recipient), memoserv_get_account(sender), str);
}
return 0;
--- 496,502 ----
}
! memo = add_memo(sent, memoserv_get_account(recipient), memoserv_get_account(sender), str);
! if ((str = database_get_data(hir->d.object, KEY_READ, RECDB_QSTRING)))
! memo->is_read = 1;
}
return 0;
***************
*** 516,519 ****
--- 521,526 ----
saxdb_write_string(ctx, KEY_FROM, memo->sender->handle->handle);
saxdb_write_string(ctx, KEY_MESSAGE, memo->message);
+ if (memo->is_read)
+ saxdb_write_int(ctx, KEY_READ, 1);
saxdb_end_record(ctx);
}
|