refactor: cleanup and sync

* Fix Jenkins scripts and sync with ndn-cxx
* Sync waf-tools
* Remove ChronoSync submodule
* Remove commented/dead code and includes
* Use ScopedEventId and ScopedRegisteredPrefixHandle
* Set setCanBePrefix to true explicitly everywhere
* Fix macOS build, add GHA CI
* Use NDN_THROW for throwing errors
* Other smaller fixes

Change-Id: I615e0e239511b97101852e1d7c620a2071a18ff8
diff --git a/src/chat-dialog-backend.cpp b/src/chat-dialog-backend.cpp
index 234e4a3..53bfdb3 100644
--- a/src/chat-dialog-backend.cpp
+++ b/src/chat-dialog-backend.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
 /*
- * Copyright (c) 2013-2016, Regents of the University of California
+ * Copyright (c) 2013-2020, Regents of the University of California
  *                          Yingdi Yu
  *
  * BSD license, See the LICENSE file for more information
@@ -68,7 +68,7 @@
     try {
       m_face->getIoService().run();
     }
-    catch (std::runtime_error& e) {
+    catch (const std::runtime_error& e) {
       {
         std::lock_guard<std::mutex>lock(m_nfdConnectionMutex);
         m_isNfdConnected = false;
@@ -131,10 +131,8 @@
                         bind(&ChatDialogBackend::sendJoin, this));
 
   // cancel existing hello event if it exists
-  if (m_helloEventId) {
+  if (m_helloEventId)
     m_helloEventId.cancel();
-    m_helloEventId.reset();
-  }
 }
 
 class IoDeviceSource
@@ -229,7 +227,7 @@
   try {
     msg.wireDecode(data.getContent().blockFromValue());
   }
-  catch (tlv::Error&) {
+  catch (const tlv::Error&) {
     // nasty stuff: as a remedy, we'll form some standard msg for inparsable msgs
     msg.setNick("inconnu");
     msg.setMsgType(ChatMessage::OTHER);
@@ -243,7 +241,7 @@
 
     if (it != m_roster.end()) {
       // cancel timeout event
-      if (static_cast<bool>(it->second.timeoutEventId))
+      if (it->second.timeoutEventId)
         it->second.timeoutEventId.cancel();
 
       // notify frontend to remove the remote session (node)
@@ -268,10 +266,6 @@
 
     uint64_t seqNo = data.getName().get(-1).toNumber();
 
-    // If a timeout event has been scheduled, cancel it.
-    if (static_cast<bool>(it->second.timeoutEventId))
-      it->second.timeoutEventId.cancel();
-
     // (Re)schedule another timeout event after 3 HELLO_INTERVAL;
     it->second.timeoutEventId =
       m_scheduler->schedule(HELLO_INTERVAL * 3,
@@ -414,7 +408,7 @@
 void
 ChatDialogBackend::prepareChatMessage(const QString& text,
                                       time_t timestamp,
-                                      ChatMessage &msg)
+                                      ChatMessage& msg)
 {
   msg.setNick(m_nick);
   msg.setChatroomName(m_chatroomName);
@@ -514,5 +508,4 @@
 
 #if WAF
 #include "chat-dialog-backend.moc"
-// #include "chat-dialog-backend.cpp.moc"
 #endif