Initial Release 3.4

Function : Unread Notes
NSFDbSetUnreadNoteTable - Store list of unread notes for user
----------------------------------------------------------------------------------------------------------

#include <nsfdb.h>

STATUS LNPUBLIC NSFDbSetUnreadNoteTable(
DBHANDLE hDB,
char far *UserName,
WORD UserNameLength,
BOOL fFlushToDisk,
DHANDLE hOriginalUnreadList,
DHANDLE hUnreadUnreadList);

Description :

This function merges changes between the original ID table and the modified table into the specified user's unread note list for the database. After this call completes, both the original unread table and the supplied unread table are updated to reflect the current state of the unread note list for the database. Prior to Release 4.5 of Notes, this function will only work with local databases. If both the server and the workstation have Release 4.5 or later of Domino and Notes installed, this function will also work with remote databases.

The user name must be the complete user name, as it would be retrieved from the user's ID file. In particular, if the name is hierarchical, the user name string must be the fully distinguished hierarchical user name. This form of the name can be obtained by calling DNCanonicalize().

In normal operation, updates to the unread note list are buffered in memory. The flag fFlushToDisk may be set to TRUE to write the updates immediately to disk.

In Domino and Notes, unread marks for each user are stored in the client desktop.dsk file and in the database. When a user closes a database (either through the Notes user interface or through an API program), the unread marks in the desktop.dsk file and in the database are synchronized so that they match. Unread marks are not replicated when a database is replicated. Instead, when a user opens a replica of a database, the unread marks from the desktop.dsk file propagates to the replica database. NSFDbSetUnreadNoteTable only accesses the unread marks stored in the database and does not attempt to synchronize with the unread marks in desktop.dsk.

Parameters :

Sample Usage :

DBHANDLE hDb;
STATUS status;
DHANDLE hTable;
DHANDLE hOriginalTable;
char UserName [MAXUSERNAME + 1];

/* Get the current user name */
status = SECKFMGetUserName (UserName);

/* Get the unread list */
status = NSFDbGetUnreadNoteTable (
hDb,
UserName,
strlen (UserName),
TRUE, /* Create list if it's not already there */
&hTable);

/* Bring table up to date */
status = NSFDbUpdateUnread (hDb, hTable);

      /* Notes requires original unread table to merge changes */
status = IDTableCopy (hTable, &hOriginalTable);

   if ( status != NOERROR )
   {
       IDDestroyTable(hTable);
       return(status);
   }

/* Make some changes */
status = IDInsert (hTable, 0x2102L, NULL);
status = IDDelete (hTable, 0x20FEL, NULL);

/* Merge changes */
status = NSFDbSetUnreadNoteTable (
hDb,
UserName,
strlen (UserName),
FALSE, /* Don't force the write to disk */
hOriginalTable,
hTable);

status = IDDestroyTable (hOriginalTable);


   status = IDDestroyTable (hTable);

See Also :

NSFDbUpdateUnread
----------------------------------------------------------------------------------------------------------