示例#1
0
// If $set is true, it sets the alive status of the notes editor.
// If $set is false, it returns the alive status.
bool Ipc_Notes::alive (void * webserver_request, bool set, bool alive)
{
  Webserver_Request * request = (Webserver_Request *) webserver_request;
  string user = request->session_logic()->currentUser ();
  if (set) {
    request->database_ipc()->storeMessage (user, "", "notesalive", convert_to_string (alive));
  } else {
    return request->database_ipc()->getNotesAlive ();
  }
  return false;
}
示例#2
0
void Ipc_Notes::erase (void * webserver_request)
{
  Webserver_Request * request = (Webserver_Request *) webserver_request;
  Database_Ipc_Message data = request->database_ipc()->getNote ();
  int counter = 0;
  while (data.id && (counter < 100)) {
    int id = data.id;
    request->database_ipc()->deleteMessage (id);
    counter++;
  }
}
示例#3
0
int Ipc_Notes::get (void * webserver_request)
{
  Webserver_Request * request = (Webserver_Request *) webserver_request;
  Database_Ipc_Message data = request->database_ipc()->getNote ();
  return convert_to_int (data.message);
}
示例#4
0
void Ipc_Notes::open (void * webserver_request, int identifier)
{
  Webserver_Request * request = (Webserver_Request *) webserver_request;
  string user = request->session_logic()->currentUser ();
  request->database_ipc()->storeMessage (user, "", "opennote", convert_to_string (identifier));
}