From 7323075827b50a48b422a4e5e640e0d3d63a3045 Mon Sep 17 00:00:00 2001 From: Teus Benschop Date: Tue, 16 Apr 2024 20:40:35 +0200 Subject: [PATCH] Make namespace std explicit --- book/create.cpp | 24 +++++------ changes/change.cpp | 73 +++++++++++++++++---------------- changes/changes.cpp | 99 ++++++++++++++++++++++----------------------- changes/logic.cpp | 19 +++++---- changes/manage.cpp | 21 +++++----- 5 files changed, 116 insertions(+), 120 deletions(-) diff --git a/book/create.cpp b/book/create.cpp index 00aa7811a..724b46b16 100644 --- a/book/create.cpp +++ b/book/create.cpp @@ -27,18 +27,18 @@ #include #include #include -using namespace std; // Creates book template with ID $book in Bible $bible. // If a $chapter is given instead of -1, it creates that chapter only. // If the $chapter is -1, it creates all chapters within that book. -bool book_create (const string & bible, const book_id book, const int chapter, vector & feedback) +bool book_create (const std::string & bible, const book_id book, const int chapter, + std::vector& feedback) { Database_Bibles database_bibles {}; Database_Versifications database_versifications {}; - vector bibles = database_bibles.get_bibles (); + const std::vector bibles = database_bibles.get_bibles (); if (!in_array (bible, bibles)) { feedback.push_back (translate("Bible bible does not exist: Cannot create book")); return false; @@ -49,10 +49,10 @@ bool book_create (const string & bible, const book_id book, const int chapter, v } // The chapters that have been created. - vector chapters_created {}; + std::vector chapters_created {}; // The USFM created. - string data {}; + std::string data {}; // Chapter 0. if (chapter <= 0) { @@ -65,12 +65,12 @@ bool book_create (const string & bible, const book_id book, const int chapter, v // Subsequent chapters. - string versification = Database_Config_Bible::getVersificationSystem (bible); - vector versification_data = database_versifications.getBooksChaptersVerses (versification); - for (const auto & row : versification_data) { + const std::string versification = Database_Config_Bible::getVersificationSystem (bible); + const std::vector versification_data = database_versifications.getBooksChaptersVerses (versification); + for (const auto& row : versification_data) { if (book == static_cast(row.m_book)) { - int ch = row.m_chapter; - int verse = filter::strings::convert_to_int (row.m_verse); + const int ch = row.m_chapter; + const int verse = filter::strings::convert_to_int (row.m_verse); if ((chapter < 0) || (chapter == ch)) { data = "\\c " + filter::strings::convert_to_string (ch) + "\n"; data += "\\p\n"; @@ -88,8 +88,8 @@ bool book_create (const string & bible, const book_id book, const int chapter, v feedback.push_back (translate("No chapters have been created")); return false; } - string created; - for (auto & chapter_created : chapters_created) { + std::string created; + for (const auto& chapter_created : chapters_created) { if (!created.empty ()) created.append (" "); created.append (filter::strings::convert_to_string (chapter_created)); } diff --git a/changes/change.cpp b/changes/change.cpp index 3efdf0cf8..382235046 100644 --- a/changes/change.cpp +++ b/changes/change.cpp @@ -46,10 +46,9 @@ #include #endif #pragma GCC diagnostic pop -using namespace std; -string changes_change_url () +std::string changes_change_url () { return "changes/change"; } @@ -61,7 +60,7 @@ bool changes_change_acl (Webserver_Request& webserver_request) } -string changes_change (Webserver_Request& webserver_request) +std::string changes_change (Webserver_Request& webserver_request) { Database_Modifications database_modifications {}; Database_Notes database_notes (webserver_request); @@ -70,35 +69,35 @@ string changes_change (Webserver_Request& webserver_request) // Note unsubscribe handler. if (webserver_request.post.count ("unsubscribe")) { - string unsubscribe = webserver_request.post["unsubscribe"]; + std::string unsubscribe = webserver_request.post["unsubscribe"]; unsubscribe.erase (0, 11); notes_logic.unsubscribe (filter::strings::convert_to_int (unsubscribe)); - return string(); + return std::string(); } // Note unassign handler. if (webserver_request.post.count ("unassign")) { - string unassign = webserver_request.post["unassign"]; + std::string unassign = webserver_request.post["unassign"]; unassign.erase (0, 8); notes_logic.unassignUser (filter::strings::convert_to_int (unassign), webserver_request.session_logic()->currentUser ()); - return string(); + return std::string(); } // Note mark for deletion handler. if (webserver_request.post.count("delete")) { - string erase = webserver_request.post["delete"]; + std::string erase = webserver_request.post["delete"]; erase.erase (0, 6); const int identifier {filter::strings::convert_to_int (erase)}; notes_logic.markForDeletion (identifier); - return string(); + return std::string(); } // From here on the script will produce output. Assets_View view {}; - const string username {webserver_request.session_logic()->currentUser ()}; + const std::string username {webserver_request.session_logic()->currentUser ()}; const int level {webserver_request.session_logic ()->currentLevel ()}; @@ -108,39 +107,39 @@ string changes_change (Webserver_Request& webserver_request) // Get old text, modification, new text, date. - const string old_text {database_modifications.getNotificationOldText (id)}; + const std::string old_text {database_modifications.getNotificationOldText (id)}; view.set_variable ("old_text", old_text); - const string modification {database_modifications.getNotificationModification (id)}; + const std::string modification {database_modifications.getNotificationModification (id)}; view.set_variable ("modification", modification); - const string new_text {database_modifications.getNotificationNewText (id)}; + const std::string new_text {database_modifications.getNotificationNewText (id)}; view.set_variable ("new_text", new_text); - const string date {locale_logic_date (database_modifications.getNotificationTimeStamp (id))}; + const std::string date {locale_logic_date (database_modifications.getNotificationTimeStamp (id))}; view.set_variable ("date", date); // Bibles and passage. const Passage passage {database_modifications.getNotificationPassage (id)}; - const vector bibles {access_bible::bibles (webserver_request)}; + const std::vector bibles {access_bible::bibles (webserver_request)}; // Get notes for the passage. - vector notes = database_notes.select_notes (bibles, // Bibles. - passage.m_book, passage.m_chapter, filter::strings::convert_to_int (passage.m_verse), - 0, // Passage selector. - 0, // Edit selector. - 0, // Non-edit selector. - "", // Status selector. - "", // Bible selector. - "", // Assignment selector. - 0, // Subscription selector. - -1, // Severity selector. - 0, // Text selector. - "", // Search text. - -1); // Limit. + std::vector notes = database_notes.select_notes (bibles, // Bibles. + passage.m_book, passage.m_chapter, filter::strings::convert_to_int (passage.m_verse), + 0, // Passage selector. + 0, // Edit selector. + 0, // Non-edit selector. + "", // Status selector. + "", // Bible selector. + "", // Assignment selector. + 0, // Subscription selector. + -1, // Severity selector. + 0, // Text selector. + "", // Search text. + -1); // Limit. // Remove the ones marked for deletion. { - vector notes2; + std::vector notes2; for (const auto note : notes) { if (!database_notes.is_marked_for_deletion (note)) { notes2.push_back (note); @@ -150,9 +149,9 @@ string changes_change (Webserver_Request& webserver_request) } // Sort them, most recent notes first. - vector timestamps; + std::vector timestamps {}; for (const auto note : notes) { - int timestap = database_notes.get_modified (note); + const int timestap = database_notes.get_modified (note); timestamps.push_back (timestap); } filter::strings::quick_sort (timestamps, notes, 0, static_cast (notes.size ())); @@ -160,7 +159,7 @@ string changes_change (Webserver_Request& webserver_request) // Whether there"s a live notes editor available. - bool live_notes_editor = Ipc_Notes::alive (webserver_request, false); + const bool live_notes_editor = Ipc_Notes::alive (webserver_request, false); if (live_notes_editor) view.enable_zone ("alive"); else @@ -170,14 +169,14 @@ string changes_change (Webserver_Request& webserver_request) // Details for the notes. pugi::xml_document notes_document {}; for (const auto note : notes) { - string summary = database_notes.get_summary (note); + std::string summary = database_notes.get_summary (note); summary = filter::strings::escape_special_xml_characters (summary); - bool subscription = database_notes.is_subscribed (note, username); - bool assignment = database_notes.is_assigned (note, username); + const bool subscription = database_notes.is_subscribed (note, username); + const bool assignment = database_notes.is_assigned (note, username); pugi::xml_node tr_node = notes_document.append_child("tr"); pugi::xml_node td_node = tr_node.append_child("td"); pugi::xml_node a_node = td_node.append_child("a"); - string href {}; + std::string href {}; if (live_notes_editor) { a_node.append_attribute("class") = "opennote"; href = filter::strings::convert_to_string (note); @@ -205,7 +204,7 @@ string changes_change (Webserver_Request& webserver_request) a_node2.text().set(("[" + translate("mark for deletion") + "]").c_str()); } } - stringstream notesblock {}; + std::stringstream notesblock {}; notes_document.print(notesblock, "", pugi::format_raw); view.set_variable ("notesblock", notesblock.str()); diff --git a/changes/changes.cpp b/changes/changes.cpp index 07fd44e5b..f50a052e2 100644 --- a/changes/changes.cpp +++ b/changes/changes.cpp @@ -47,10 +47,9 @@ #include #endif #pragma GCC diagnostic pop -using namespace std; -string changes_changes_url () +std::string changes_changes_url () { return "changes/changes"; } @@ -62,7 +61,7 @@ bool changes_changes_acl (Webserver_Request& webserver_request) } -string changes_changes (Webserver_Request& webserver_request) +std::string changes_changes (Webserver_Request& webserver_request) { Database_Modifications database_modifications; @@ -70,18 +69,18 @@ string changes_changes (Webserver_Request& webserver_request) // Handle AJAX call to load the summary of a change notification. if (webserver_request.query.count ("load")) { const int identifier = filter::strings::convert_to_int (webserver_request.query["load"]); - stringstream block {}; + std::stringstream block {}; const Passage passage = database_modifications.getNotificationPassage (identifier); - const string link = filter_passage_link_for_opening_editor_at (passage.m_book, passage.m_chapter, passage.m_verse); - string category = database_modifications.getNotificationCategory (identifier); - if (category == changes_personal_category ()) + const std::string link = filter_passage_link_for_opening_editor_at (passage.m_book, passage.m_chapter, passage.m_verse); + std::string category = database_modifications.getNotificationCategory (identifier); + if (category == changes_personal_category ()) category = filter::strings::emoji_smiling_face_with_smiling_eyes (); if (category == changes_bible_category ()) category = filter::strings::emoji_open_book (); - string modification = database_modifications.getNotificationModification (identifier); - block << "
\n"; - block << "" << filter::strings::emoji_file_folder () << "\n"; - block << "" << filter::strings::emoji_wastebasket () << "\n"; + std::string modification = database_modifications.getNotificationModification (identifier); + block << "
\n"; + block << "" << filter::strings::emoji_file_folder () << "\n"; + block << "" << filter::strings::emoji_wastebasket () << "\n"; block << link << "\n"; block << category << "\n"; block << modification << "\n"; @@ -99,13 +98,13 @@ string changes_changes (Webserver_Request& webserver_request) webserver_request.database_config_user ()->addRemovedChange (remove); #endif webserver_request.database_config_user ()->setChangeNotificationsChecksum (""); - return string(); + return std::string(); } // Handle AJAX call to navigate to the passage belonging to the change notification. if (webserver_request.post.count ("navigate")) { - string navigate = webserver_request.post["navigate"]; + const std::string navigate = webserver_request.post["navigate"]; const int id = filter::strings::convert_to_int (navigate); const Passage passage = database_modifications.getNotificationPassage (id); if (passage.m_book) { @@ -113,15 +112,15 @@ string changes_changes (Webserver_Request& webserver_request) Navigation_Passage::record_history (webserver_request, passage.m_book, passage.m_chapter, filter::strings::convert_to_int (passage.m_verse)); } // Set the correct default Bible for the user. - const string bible = database_modifications.getNotificationBible (id); - if (!bible.empty ()) + const std::string bible = database_modifications.getNotificationBible (id); + if (!bible.empty ()) webserver_request.database_config_user()->setBible (bible); - return string(); + return std::string(); } // Handle query to update the sorting order. - const string sort = webserver_request.query ["sort"]; + const std::string sort = webserver_request.query ["sort"]; if (sort == "verse") { webserver_request.database_config_user ()->setOrderChangesByAuthor (false); } @@ -130,11 +129,11 @@ string changes_changes (Webserver_Request& webserver_request) } - const string username = webserver_request.session_logic()->currentUser (); + const std::string username = webserver_request.session_logic()->currentUser (); const bool touch = webserver_request.session_logic ()->touchEnabled (); - string page {}; + std::string page {}; Assets_Header header = Assets_Header (translate("Changes"), webserver_request); header.set_stylesheet (); header.add_bread_crumb (menu_logic_translate_menu (), menu_logic_translate_text ()); @@ -144,7 +143,7 @@ string changes_changes (Webserver_Request& webserver_request) // The selected Bible, that is, the Bible for which to show the change notifications. - string selectedbible = webserver_request.query ["selectedbible"]; + std::string selectedbible = webserver_request.query ["selectedbible"]; if (webserver_request.query.count ("selectbible")) { selectedbible = webserver_request.query ["selectbible"]; } @@ -152,9 +151,9 @@ string changes_changes (Webserver_Request& webserver_request) // Remove a user's personal changes notifications and their matching change notifications in the Bible. - const string matching = webserver_request.query ["matching"]; + const std::string matching = webserver_request.query ["matching"]; if (!matching.empty ()) { - vector ids = database_modifications.clearNotificationMatches (username, matching, changes_bible_category (), selectedbible); + std::vector ids = database_modifications.clearNotificationMatches (username, matching, changes_bible_category (), selectedbible); #ifdef HAVE_CLIENT // Client records deletions for sending to the Cloud. for (const auto id : ids) { @@ -168,7 +167,7 @@ string changes_changes (Webserver_Request& webserver_request) // Remove all the personal change notifications. if (webserver_request.query.count ("personal")) { - vector ids = database_modifications.getNotificationTeamIdentifiers (username, changes_personal_category (), selectedbible); + std::vector ids = database_modifications.getNotificationTeamIdentifiers (username, changes_personal_category (), selectedbible); for (const auto id : ids) { trash_change_notification (webserver_request, id); database_modifications.deleteNotification (id); @@ -182,7 +181,7 @@ string changes_changes (Webserver_Request& webserver_request) // Remove all the Bible change notifications. if (webserver_request.query.count ("bible")) { - vector ids = database_modifications.getNotificationTeamIdentifiers (username, changes_bible_category (), selectedbible); + std::vector ids = database_modifications.getNotificationTeamIdentifiers (username, changes_bible_category (), selectedbible); for (const auto id : ids) { trash_change_notification (webserver_request, id); database_modifications.deleteNotification (id); @@ -196,8 +195,8 @@ string changes_changes (Webserver_Request& webserver_request) // Remove all the change notifications made by a certain user. if (webserver_request.query.count ("dismiss")) { - string user = webserver_request.query ["dismiss"]; - vector ids = database_modifications.getNotificationTeamIdentifiers (username, user, selectedbible); + const std::string user = webserver_request.query ["dismiss"]; + std::vector ids = database_modifications.getNotificationTeamIdentifiers (username, user, selectedbible); for (auto id : ids) { trash_change_notification (webserver_request, id); database_modifications.deleteNotification (id); @@ -211,25 +210,25 @@ string changes_changes (Webserver_Request& webserver_request) // Read the identifiers, optionally sorted on author (that is, category). bool sort_on_author = webserver_request.database_config_user ()->getOrderChangesByAuthor (); - vector notification_ids = database_modifications.getNotificationIdentifiers (username, selectedbible, sort_on_author); + const std::vector notification_ids = database_modifications.getNotificationIdentifiers (username, selectedbible, sort_on_author); // Send the identifiers to the browser for download there. - string pendingidentifiers {}; - for (auto id : notification_ids) { + std::string pendingidentifiers {}; + for (const auto id : notification_ids) { if (!pendingidentifiers.empty ()) pendingidentifiers.append (" "); pendingidentifiers.append (filter::strings::convert_to_string (id)); } view.set_variable ("pendingidentifiers", pendingidentifiers); - stringstream loading {}; + std::stringstream loading {}; loading << "var loading = " << quoted(translate("Loading ...")) << ";"; - string script = loading.str(); + std::string script = loading.str(); config::logic::swipe_enabled (webserver_request, script); view.set_variable ("script", script); // Add links to enable the user to show the change notifications for one Bible or for all Bibles. - vector distinct_bibles = database_modifications.getNotificationDistinctBibles (username); + std::vector distinct_bibles = database_modifications.getNotificationDistinctBibles (username); // Show the Bible selector if there's more than one distinct Bible. bool show_bible_selector = distinct_bibles.size () > 1; // Also show the Bible selector if there's no change notifications to display, yet there's at least one distinct Bible. @@ -243,23 +242,23 @@ string changes_changes (Webserver_Request& webserver_request) if (distinct_bibles.size () > 1) distinct_bibles.insert (distinct_bibles.begin(), ""); // Iterate over the Bibles and make them all selectable. for (const auto & bible : distinct_bibles) { - string cssclass {}; + std::string cssclass {}; if (selectedbible == bible) cssclass = "active"; - string name (bible); + std::string name (bible); if (name.empty ()) name = translate ("All Bibles"); - view.add_iteration ("bibleselector", { pair ("selectbible", bible), pair ("biblename", name), pair ("class", cssclass) } ); + view.add_iteration ("bibleselector", { std::pair ("selectbible", bible), std::pair ("biblename", name), std::pair ("class", cssclass) } ); } } // Enable links to dismiss categories of notifications depending on whether there's anything to dismiss. // And give details about the number of changes. - vector personal_ids = database_modifications.getNotificationTeamIdentifiers (username, changes_personal_category (), selectedbible); + std::vector personal_ids = database_modifications.getNotificationTeamIdentifiers (username, changes_personal_category (), selectedbible); if (!personal_ids.empty ()) { view.enable_zone ("personal"); view.set_variable ("personalcount", filter::strings::convert_to_string (personal_ids.size ())); } - vector bible_ids = database_modifications.getNotificationTeamIdentifiers (username, changes_bible_category (), selectedbible); + const std::vector bible_ids = database_modifications.getNotificationTeamIdentifiers (username, changes_bible_category (), selectedbible); if (!bible_ids.empty ()) { view.enable_zone ("bible"); view.set_variable ("teamcount", filter::strings::convert_to_string (bible_ids.size ())); @@ -267,33 +266,33 @@ string changes_changes (Webserver_Request& webserver_request) // Add links to clear the notifications from the individual contributors. - vector categories = database_modifications.getCategories (); + const std::vector categories = database_modifications.getCategories (); for (const auto & category : categories) { if (category == changes_personal_category ()) continue; if (category == changes_bible_category ()) continue; - const string & user = category; - vector ids = database_modifications.getNotificationTeamIdentifiers (username, user, selectedbible); + const std::string& user = category; + const std::vector ids = database_modifications.getNotificationTeamIdentifiers (username, user, selectedbible); if (!ids.empty ()) { view.add_iteration ("individual", { - pair ("user", user), - pair ("selectedbible", selectedbible), - pair ("count", filter::strings::convert_to_string(ids.size())) + std::pair ("user", user), + std::pair ("selectedbible", selectedbible), + std::pair ("count", filter::strings::convert_to_string(ids.size())) }); } } // Add links to clear matching notifications of the various users. - for (const auto & category : categories) { + for (const auto& category : categories) { if (category == changes_bible_category ()) continue; - const string & user = category; - vector personal_ids2 = database_modifications.getNotificationTeamIdentifiers (username, user, selectedbible); - string user_and_icon = translate ("user") + " " + category; + const std::string& user = category; + std::vector personal_ids2 = database_modifications.getNotificationTeamIdentifiers (username, user, selectedbible); + std::string user_and_icon = translate ("user") + " " + category; if (category == changes_personal_category ()) { user_and_icon = translate ("me") + " " + filter::strings::emoji_smiling_face_with_smiling_eyes (); } if (!personal_ids2.empty () && !bible_ids.empty ()) { - view.add_iteration ("matching", { pair ("user", user), pair ("icon", user_and_icon) } ); + view.add_iteration ("matching", { std::pair ("user", user), std::pair ("icon", user_and_icon) } ); } } @@ -308,8 +307,8 @@ string changes_changes (Webserver_Request& webserver_request) // Create data for the link for how to sort the change notifications. - string sortquery {}; - string sorttext {}; + std::string sortquery {}; + std::string sorttext {}; if (webserver_request.database_config_user ()->getOrderChangesByAuthor ()) { sortquery = "verse"; sorttext = translate ("Sort on verse" ); diff --git a/changes/logic.cpp b/changes/logic.cpp index b1dc77efe..ec6ef8c90 100644 --- a/changes/logic.cpp +++ b/changes/logic.cpp @@ -40,7 +40,6 @@ #include #include #include -using namespace std; void changes_logic_start () @@ -61,11 +60,11 @@ const char * changes_bible_category () } -string changes_interlinks (Webserver_Request& webserver_request, string my_url) +std::string changes_interlinks (Webserver_Request& webserver_request, std::string my_url) { // Storage the available links. - vector urls {}; - vector labels {}; + std::vector urls {}; + std::vector labels {}; // Handle situation that the user has permission to view the changes. if (changes_changes_acl (webserver_request)) { @@ -87,7 +86,7 @@ string changes_interlinks (Webserver_Request& webserver_request, string my_url) } } - string revisions = "revisions"; + const std::string revisions = "revisions"; if (index_listing_url (revisions) != my_url) { if (index_listing_acl (webserver_request, revisions)) { urls.push_back (index_listing_url (revisions)); @@ -114,19 +113,19 @@ string changes_interlinks (Webserver_Request& webserver_request, string my_url) } first = false; pugi::xml_node a = document.append_child ("a"); - string href = "/" + urls[i]; + const std::string href = "/" + urls[i]; a.append_attribute ("href") = href.c_str(); a.text ().set (labels[i].c_str()); } // Convert the document to a string. - stringstream output {}; + std::stringstream output {}; document.print (output, "", pugi::format_raw); return output.str (); } -void changes_clear_notifications_user (string jobid, string username) +void changes_clear_notifications_user (std::string jobid, std::string username) { Database_Logs::log (translate ("Start clearing change notifications") + " " + username); @@ -134,8 +133,8 @@ void changes_clear_notifications_user (string jobid, string username) Database_Jobs database_jobs {}; // Get the total amount of change notifications to clear for the user. - string any_bible {}; - vector identifiers = database_modifications.getNotificationIdentifiers (username, any_bible); + std::string any_bible {}; + std::vector identifiers = database_modifications.getNotificationIdentifiers (username, any_bible); // Total notes cleared. int total_cleared {0}; diff --git a/changes/manage.cpp b/changes/manage.cpp index 8bae97437..03cb631f8 100644 --- a/changes/manage.cpp +++ b/changes/manage.cpp @@ -39,10 +39,9 @@ #include #include #include -using namespace std; -string changes_manage_url () +std::string changes_manage_url () { return "changes/manage"; } @@ -54,12 +53,12 @@ bool changes_manage_acl (Webserver_Request& webserver_request) } -string changes_manage (Webserver_Request& webserver_request) +std::string changes_manage (Webserver_Request& webserver_request) { Database_Modifications database_modifications {}; - string page {}; + std::string page {}; Assets_Header header = Assets_Header (translate("Changes"), webserver_request); header.add_bread_crumb (menu_logic_settings_menu (), menu_logic_settings_text ()); page = header.run (); @@ -67,18 +66,18 @@ string changes_manage (Webserver_Request& webserver_request) if (webserver_request.query.count("clear")) { - string username = webserver_request.query["clear"]; + const std::string username = webserver_request.query["clear"]; // This may take time in case there are many change notifications to clear. // If there's 2000+ notifications, it takes a considerable time. // For that reason, it starts a background job to clear the change notifications. // The app will remain responsive to the user. Database_Jobs database_jobs {}; - int jobId = database_jobs.get_new_id (); + const int jobId = database_jobs.get_new_id (); database_jobs.set_level (jobId, Filter_Roles::manager ()); database_jobs.set_start (jobId, translate ("Clearing change notifications.")); tasks_logic_queue (DELETECHANGES, {filter::strings::convert_to_string (jobId), username}); redirect_browser (webserver_request, jobs_index_url () + "?id=" + filter::strings::convert_to_string (jobId)); - return string(); + return std::string(); } @@ -89,13 +88,13 @@ string changes_manage (Webserver_Request& webserver_request) bool notifications {false}; - vector users = access_user::assignees (webserver_request); + std::vector users = access_user::assignees (webserver_request); for (const auto& user : users) { - string any_bible {}; - vector ids = database_modifications.getNotificationIdentifiers (user, any_bible); + std::string any_bible {}; + const std::vector ids = database_modifications.getNotificationIdentifiers (user, any_bible); if (!ids.empty ()) { notifications = true; - map values {}; + std::map values {}; values ["user"] = user; values ["count"] = filter::strings::convert_to_string (ids.size ()); view.add_iteration ("notifications", values);