diff --git a/CMake/Utils.cmake b/CMake/Utils.cmake index 102963fa134dbc6aa3d8a3b559f83822b2044afb..da9aa2ecfdf889fb750cb903cc2c2012a2e53c1a 100644 --- a/CMake/Utils.cmake +++ b/CMake/Utils.cmake @@ -148,7 +148,7 @@ function(add_custom_command_if) add_custom_command_if_parse_arguments(${ARGN}) if(OUTPUT AND TARGET) - message(FATAL_ERROR "Wrong syntax. A TARGET and OUTPUT can not both be specified.") + message(FATAL_ERROR "Wrong syntax. A TARGET and OUTPUT are unable to be both specified.") endif() if(OUTPUT) diff --git a/NEWS b/NEWS index 9f73aef40459d2a474225ddf5496abb15cf00a32..10f0efb82108bf5fea6481c740e14b070ecd6ff8 100644 --- a/NEWS +++ b/NEWS @@ -132,7 +132,7 @@ SFLphoned/SFLphone (0.5a) / 2005-10-17 SFLphone (0.4.1-pre2) / 2005-09-30 * rearranged utilspp use - * Bug fix when trying to use more than 6 lines. + * Bug fix when attempting to use more than 6 lines. * Now, we send a final response to reINVITEs (thanks to Mikael Magnusson) * We can build in different build directories. diff --git a/bin/dbus/cx.ring.Ring.ConfigurationManager.xml b/bin/dbus/cx.ring.Ring.ConfigurationManager.xml index d7ae9e1131e36bfb61fba15fd590b216330e8de0..796661a13f2956709b51b939f8c4af774cb2307a 100644 --- a/bin/dbus/cx.ring.Ring.ConfigurationManager.xml +++ b/bin/dbus/cx.ring.Ring.ConfigurationManager.xml @@ -212,8 +212,8 @@ Status code: 0 for success <ul> <li>SUCCESS = 0 everything went fine. PIN is set.</li> - <li>WRONG_PASSWORD = 1 wrong password provided.</li> - <li>NETWORK_ERROR = 2 can't publish archive on the network.</li> + <li>WRONG_PASSWORD = 1 incorrect password provided.</li> + <li>NETWORK_ERROR = 2 unable to publish archive on the network.</li> </ul> </tp:docstring> </arg> @@ -256,7 +256,7 @@ Status code: 0 for success <ul> <li>SUCCESS = 0 everything went fine. Device is now revoked.</li> - <li>WRONG_PASSWORD = 1 revocation failed: wrong password.</li> + <li>WRONG_PASSWORD = 1 revocation failed: incorrect password.</li> <li>UNKNOWN_DEVICE = 2 revocation failed: unknown device.</li> </ul> </tp:docstring> @@ -417,7 +417,7 @@ Status code: 0 for success <ul> <li>SUCCESS = 0 everything went fine. Name is now registered.</li> - <li>WRONG_PASSWORD = 1 registration failed: wrong password.</li> + <li>WRONG_PASSWORD = 1 registration failed: incorrect password.</li> <li>INVALID_NAME = 2 registration failed: invalid name.</li> <li>ALREADY_TAKEN = 3 registration failed: name is already taken.</li> <li>NETWORK_ERROR = 4 registration failed: network or server error.</li> diff --git a/bin/jni/videomanager.i b/bin/jni/videomanager.i index 538adc8b72cc09e8f30f1a52659266760197683c..f6a0137f766dcd979cc418649a9bf797360aaf7a 100644 --- a/bin/jni/videomanager.i +++ b/bin/jni/videomanager.i @@ -314,7 +314,7 @@ void releaseBuffer(ANativeWindow *window, libjami::FrameBuffer frame) try { windows.at(window) = std::move(frame); } catch (...) { - __android_log_print(ANDROID_LOG_WARN, TAG, "Can't move frame: no window"); + __android_log_print(ANDROID_LOG_WARN, TAG, "Unable to move frame: no window"); } } @@ -342,7 +342,7 @@ libjami::FrameBuffer sinkTargetPullCallback(ANativeWindow *window) frame->linesize[0] = buffer.stride * 4; return frame; } else { - __android_log_print(ANDROID_LOG_WARN, TAG, "Can't lock window"); + __android_log_print(ANDROID_LOG_WARN, TAG, "Unable to lock window"); releaseBuffer(window, std::move(frame)); } } diff --git a/compat/msvc/winmake.py b/compat/msvc/winmake.py index ee144a6744995030ac73e5efb14caae10ff3e821..52c197ec649a3a43573b7a23b490b7a117b45cb9 100644 --- a/compat/msvc/winmake.py +++ b/compat/msvc/winmake.py @@ -157,7 +157,7 @@ def getCMakeGenerator(vs_version): elif vs_version == '16': return '\"Visual Studio 16 2019\" -A x64' else: - root_logger.critical("Can't return CMake generator for VS " + vs_version) + root_logger.critical("Unable to return CMake generator for VS " + vs_version) return '' @@ -327,7 +327,7 @@ def make(pkg_info, force, sdk_version, toolset, isPlugin): use_cmake=use_cmake): track_build(pkg_name, md5, False) else: - log.error("Couldn't build contrib " + pkg_name) + log.error("Unable to build contrib " + pkg_name) exit(1) log.info(pkg_name + ' up to date') return True diff --git a/configure.ac b/configure.ac index 20fe517a59d38c353161d6625e93ad0c30694b30..b9366b6c3a620aa6c735474a40f9ff7faba9c980 100644 --- a/configure.ac +++ b/configure.ac @@ -653,9 +653,9 @@ AC_DEFUN([BB_ENABLE_DOXYGEN], [use 'dot' to generate graphs in doxygen (auto)])]) if test "x$enable_doxygen" = xyes; then AC_PATH_PROG(DOXYGEN, doxygen, , $PATH) - test x$DOXYGEN = x && AC_MSG_ERROR([could not find doxygen]) + test x$DOXYGEN = x && AC_MSG_ERROR([unable to find doxygen]) AC_PATH_PROG(DOT, dot, , $PATH) - test x$DOT = x -a "x$enable_dot" = xyes && AC_MSG_ERROR([could not find dot]) + test x$DOT = x -a "x$enable_dot" = xyes && AC_MSG_ERROR([unable to find dot]) fi AM_CONDITIONAL(ENABLE_DOXYGEN, test "x$DOXYGEN" != "x")]) diff --git a/contrib/src/iconv/rules.mak b/contrib/src/iconv/rules.mak index e70ab2f7ec25fa50eb136cd66aff219e18b60d58..823d4268511e9b0560f3def23bffd91436f31993 100644 --- a/contrib/src/iconv/rules.mak +++ b/contrib/src/iconv/rules.mak @@ -3,7 +3,7 @@ LIBICONV_VERSION=1.17 LIBICONV_URL=$(GNU)/libiconv/libiconv-$(LIBICONV_VERSION).tar.gz PKGS += iconv -# iconv cannot be detect with pkg-config, but it is mandated by POSIX. +# iconv is unable to be detected with pkg-config, but it is mandated by POSIX. # Hard-code based on the operating system. ifndef HAVE_WIN32 ifndef HAVE_ANDROID diff --git a/contrib/src/main.mak b/contrib/src/main.mak index 2cde6074163f009068d415db9ea09bf9aa572c86..c0a96df4c5cb7232076a14c65315155d1232f8bc 100644 --- a/contrib/src/main.mak +++ b/contrib/src/main.mak @@ -261,7 +261,7 @@ endif FLOCK_PREFIX := $(and $(FLOCK),$(FLOCK) "$@.lock") ifeq ($(DISABLE_CONTRIB_DOWNLOADS),TRUE) -download = $(error Trying to download $(1) but DISABLE_CONTRIB_DOWNLOADS is TRUE, aborting.) +download = $(error Attempting to download $(1) but DISABLE_CONTRIB_DOWNLOADS is TRUE, aborting.) else ifeq ($(shell wget --version >/dev/null 2>&1 || echo FAIL),) download = $(FLOCK_PREFIX) wget $(if ${BATCH_MODE},-nv) -t 4 --waitretry 10 -O "$@" "$(1)" else ifeq ($(shell curl --version >/dev/null 2>&1 || echo FAIL),) @@ -351,7 +351,7 @@ HOSTVARS := $(HOSTTOOLS) \ # $3: The git refspec to checkout. # $4: Set to anything to preserve the .git directory ifeq ($(DISABLE_CONTRIB_DOWNLOADS),TRUE) -download_git = $(error Trying to clone $(1) but DISABLE_CONTRIB_DOWNLOADS is TRUE, aborting.) +download_git = $(error Attempting to clone $(1) but DISABLE_CONTRIB_DOWNLOADS is TRUE, aborting.) else download_git = $(FLOCK_PREFIX) sh -c "\ rm -Rf '$(@:.tar.xz=)' && \ diff --git a/doc/agent/workflow.rst b/doc/agent/workflow.rst index 552c04c1e3b8244eec6b75333ffde5c5ba0e57e9..dbe90ee1d91f6a2c1bd14d808403a7c2fdb36eb1 100644 --- a/doc/agent/workflow.rst +++ b/doc/agent/workflow.rst @@ -15,7 +15,7 @@ Guile bindings Guile needs primitive bindings to communicate with Jami. Usually, these bindings can written in pure Scheme using the foreign function interface (FFI) -and some dlopen() magics. However, this method cannot applies here for two main +and some dlopen() magics. However, this method is not applicable here for two main reasons: 1. Jami source code is in C++ not C. diff --git a/doc/doxygen/core-doc.cfg.in b/doc/doxygen/core-doc.cfg.in index f0b905c779960ce76dcfcd4209170476a66b122e..fcace39085ffd20c8b966bcd35f4e23392ecd920 100644 --- a/doc/doxygen/core-doc.cfg.in +++ b/doc/doxygen/core-doc.cfg.in @@ -137,7 +137,7 @@ INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path # before files name in the file list and in the header files. If set to NO the -# shortest path that makes the file name unique will be used +# shortest path that makes the filename unique will be used # The default value is: YES. FULL_PATH_NAMES = NO @@ -164,7 +164,7 @@ STRIP_FROM_PATH = STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but -# less readable) file names. This can be useful is your file systems doesn't +# less readable) filenames. This can be useful is your file systems doesn't # support long names like on DOS, Mac, or CD-ROM. # The default value is: NO. @@ -501,7 +501,7 @@ INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file # names in lower-case letters. If set to YES, upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows +# in case and if your file system supports case sensitive filenames. Windows # and Mac users are advised to set this option to NO. # The default value is: system dependent. @@ -677,7 +677,7 @@ FILE_VERSION_FILTER = # by doxygen. The layout file controls the global structure of the generated # output files in an output format independent way. To create the layout file # that represents doxygen's defaults, run doxygen with the -l option. You can -# optionally specify a file name after the option, if omitted DoxygenLayout.xml +# optionally specify a filename after the option, if omitted DoxygenLayout.xml # will be used as the name of the layout file. # # Note that if you run doxygen from a directory containing a file called @@ -766,7 +766,7 @@ WARN_LOGFILE = #--------------------------------------------------------------------------- # The INPUT tag is used to specify the files and/or directories that contain -# documented source files. You may enter file names like myfile.cpp or +# documented source files. You may enter filenames like myfile.cpp or # directories like /usr/src/myproject. Separate the files or directories with # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. @@ -889,11 +889,11 @@ IMAGE_PATH = INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. Doxygen will compare the file name with each pattern and apply the +# basis. Doxygen will compare the filename with each pattern and apply the # filter if there is a match. The filters are a list of the form: pattern=filter # (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how # filters are used. If the FILTER_PATTERNS tag is empty or if none of the -# patterns match the file name, INPUT_FILTER is applied. +# patterns match the filename, INPUT_FILTER is applied. # # Note that for custom extensions or not directly supported extensions you also # need to set EXTENSION_MAPPING for the extension otherwise the files are not @@ -1137,7 +1137,7 @@ HTML_EXTRA_STYLESHEET = # other source files which should be copied to the HTML output directory. Note # that these files will be copied to the base HTML output directory. Use the # $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these -# files. In the HTML_STYLESHEET file, use the file name only. Also note that the +# files. In the HTML_STYLESHEET file, use the filename only. Also note that the # files will be copied as-is; there are no commands or markers available. # This tag requires that the tag GENERATE_HTML is set to YES. @@ -1265,7 +1265,7 @@ DOCSET_PUBLISHER_NAME = Publisher GENERATE_HTMLHELP = NO -# The CHM_FILE tag can be used to specify the file name of the resulting .chm +# The CHM_FILE tag can be used to specify the filename of the resulting .chm # file. You can add a path in front of the file if the result should not be # written to the html output directory. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. @@ -1273,7 +1273,7 @@ GENERATE_HTMLHELP = NO CHM_FILE = # The HHC_LOCATION tag can be used to specify the location (absolute path -# including file name) of the HTML help compiler (hhc.exe). If non-empty, +# including filename) of the HTML help compiler (hhc.exe). If non-empty, # doxygen will try to run the HTML help compiler on the generated index.hhp. # The file has to be specified with full path. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. @@ -1318,7 +1318,7 @@ TOC_EXPAND = NO GENERATE_QHP = NO # If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify -# the file name of the resulting .qch file. The path specified is relative to +# the filename of the resulting .qch file. The path specified is relative to # the HTML output folder. # This tag requires that the tag GENERATE_QHP is set to YES. @@ -2078,7 +2078,7 @@ SKIP_FUNCTION_MACROS = YES TAGFILES = -# When a file name is specified after GENERATE_TAGFILE, doxygen will create a +# When a filename is specified after GENERATE_TAGFILE, doxygen will create a # tag file that is based on the input files it reads. See section "Linking to # external documentation" for more information about the usage of tag files. diff --git a/doc/trace/tracepoint-analysis.rst b/doc/trace/tracepoint-analysis.rst index bd2f7ed23514cd2c1f67d694d2031a29c1fe06e2..c68555bcd8a27e1a6909ea07c43d049ca66992e6 100644 --- a/doc/trace/tracepoint-analysis.rst +++ b/doc/trace/tracepoint-analysis.rst @@ -96,11 +96,11 @@ Once this is done, try ``lttng status`` to see what happen:: Recording event rules: jami:* (type: tracepoint) [enabled] -There's a lots of informations here. We won't go into the details of all. The +There's a lot of information here. We won't go into the details of all. The most important are the session name, and the channel's recording event rules. We can see that we're indeed in our session and that there's a recording rule ``jami:*`` for the ``channel0``. Our rule is globing all events produced by the -``jami`` provider. Other informations are documented in the LTTng' +``jami`` provider. Other information is documented in the LTTng' documentation. NOTE! Do not confuse the ``jami`` session with the ``jami`` provider. Even diff --git a/src/account.cpp b/src/account.cpp index 3c6617ff5444e621bebc685d9408e6e75d95dd51..0a765986d25f4c6bf161abb4f4d33b89afc28ad2 100644 --- a/src/account.cpp +++ b/src/account.cpp @@ -64,7 +64,7 @@ using namespace std::literals; namespace jami { -// For portability, do not specify the absolute file name of the ringtone. +// For portability, do not specify the absolute filename of the ringtone. // Instead, specify its base name to be looked in // JAMI_DATADIR/ringtones/, where JAMI_DATADIR is a preprocessor macro denoting // the data directory prefix that must be set at build time. diff --git a/src/archiver.h b/src/archiver.h index 91ff2a27711c0fc40005fff355ca4d61346272ef..d0ffd15712bcd0588a07e2d21f1632087cde5926 100644 --- a/src/archiver.h +++ b/src/archiver.h @@ -75,10 +75,10 @@ gzFile openGzip(const std::string& path, const char* mode); * in dir folder according to a FileMatchPair f * @param path * @param dir - * @param f takes a file name relative path inside the archive like mysubfolder/myfile - * and returns a pair (bool, new file name relative path) + * @param f takes a filename relative path inside the archive like mysubfolder/myfile + * and returns a pair (bool, new filename relative path) * Where the bool indicates if we should uncompress this file - * and the new file name relative path puts the file in the directory dir under a different + * and the new filename relative path puts the file in the directory dir under a different * relative path name like mynewsubfolder/myfile * @return void */ diff --git a/src/call.h b/src/call.h index a73283cf1ee64cc814bce263404840d3a6df16fe..970a04b1e3fb52e453ba12f026b6d5303314a9cd 100644 --- a/src/call.h +++ b/src/call.h @@ -434,7 +434,7 @@ public: /** * A Call can be in a conference. If this is the case, the other side - * will send conference informations describing the rendered image + * will send conference information describing the rendered image * @msg A JSON object describing the conference */ void setConferenceInfo(const std::string& msg); diff --git a/src/client/configurationmanager.cpp b/src/client/configurationmanager.cpp index 2ea5644db6b89688e11425e7c604b374d7ba5488..64227370a3ae442cd9f52aa593339319e78932e1 100644 --- a/src/client/configurationmanager.cpp +++ b/src/client/configurationmanager.cpp @@ -537,13 +537,13 @@ setCodecDetails(const std::string& accountId, { auto acc = jami::Manager::instance().getAccount(accountId); if (!acc) { - JAMI_ERR("Could not find account %s. can not set codec details", accountId.c_str()); + JAMI_ERR("Unable to find account %s. Unable to set codec details", accountId.c_str()); return false; } auto codec = acc->searchCodecById(codecId, jami::MEDIA_ALL); if (!codec) { - JAMI_ERR("can not find codec %d", codecId); + JAMI_ERR("Unable to find codec %d", codecId); return false; } try { @@ -570,7 +570,7 @@ setCodecDetails(const std::string& accountId, } } } catch (const std::exception& e) { - JAMI_ERR("Cannot set codec specifications: %s", e.what()); + JAMI_ERR("Unable to set codec specifications: %s", e.what()); } return false; @@ -581,7 +581,7 @@ getCodecDetails(const std::string& accountId, const unsigned& codecId) { auto acc = jami::Manager::instance().getAccount(accountId); if (!acc) { - JAMI_ERR("Could not find account %s return default codec details", accountId.c_str()); + JAMI_ERR("Unable to find account %s return default codec details", accountId.c_str()); return jami::Account::getDefaultCodecDetails(codecId); } @@ -608,7 +608,7 @@ getActiveCodecList(const std::string& accountId) { if (auto acc = jami::Manager::instance().getAccount(accountId)) return acc->getActiveCodecs(); - JAMI_ERR("Could not find account %s, returning default", accountId.c_str()); + JAMI_ERR("Unable to find account %s, returning default", accountId.c_str()); return jami::Account::getDefaultCodecsId(); } @@ -619,7 +619,7 @@ setActiveCodecList(const std::string& accountId, const std::vector<unsigned>& li acc->setActiveCodecs(list); jami::Manager::instance().saveConfig(acc); } else { - JAMI_ERR("Could not find account %s", accountId.c_str()); + JAMI_ERR("Unable to find account %s", accountId.c_str()); } } @@ -981,7 +981,7 @@ setCredentials(const std::string& accountId, void connectivityChanged() { - JAMI_WARN("received connectivity changed - trying to re-connect enabled accounts"); + JAMI_WARN("received connectivity changed - attempting to re-connect enabled accounts"); // reset the UPnP context #if !(defined(TARGET_OS_IOS) && TARGET_OS_IOS) diff --git a/src/client/presencemanager.cpp b/src/client/presencemanager.cpp index 9db828fd121352acbf6c3e17c374abb45e6c3847..e5a77846f1894802892f241aa3e511a69dc4004e 100644 --- a/src/client/presencemanager.cpp +++ b/src/client/presencemanager.cpp @@ -69,7 +69,7 @@ subscribeBuddy(const std::string& accountId, const std::string& uri, bool flag) accountId)) { ringaccount->trackBuddyPresence(uri, flag); } else - JAMI_ERROR("Could not find account {}", accountId); + JAMI_ERROR("Unable to find account {}", accountId); } /** @@ -92,7 +92,7 @@ publish(const std::string& accountId, bool status, const std::string& note) accountId)) { acc->sendPresenceNote(note); } else - JAMI_ERROR("Could not find account {}", accountId); + JAMI_ERROR("Unable to find account {}", accountId); } /** @@ -111,7 +111,7 @@ answerServerRequest(UNUSED const std::string& uri, UNUSED bool flag) else JAMI_ERROR("Presence not initialized"); } else - JAMI_ERROR("Could not find account IP2IP"); + JAMI_ERROR("Unable to find account IP2IP"); #else JAMI_ERROR("answerServerRequest() is deprecated and does nothing"); #endif @@ -148,7 +148,7 @@ getSubscriptions(const std::string& accountId) tracked_id.second ? libjami::Presence::ONLINE_KEY : libjami::Presence::OFFLINE_KEY}}); } } else - JAMI_ERROR("Could not find account {}", accountId); + JAMI_ERROR("Unable to find account {}", accountId); return ret; } @@ -170,7 +170,7 @@ setSubscriptions(const std::string& accountId, const std::vector<std::string>& u for (const auto& u : uris) acc->trackBuddyPresence(u, true); } else - JAMI_ERROR("Could not find account {}", accountId); + JAMI_ERROR("Unable to find account {}", accountId); } } // namespace libjami diff --git a/src/client/videomanager.cpp b/src/client/videomanager.cpp index e3846d7c470541f5ae7befa5e92c69cc3da46ecc..5990bbf97f2b387539fe7d05a95d629d42bde1bf 100644 --- a/src/client/videomanager.cpp +++ b/src/client/videomanager.cpp @@ -144,13 +144,13 @@ AudioFrame::mix(const AudioFrame& frame) auto& fIn = *frame.pointer(); if (f.ch_layout.nb_channels != fIn.ch_layout.nb_channels || f.format != fIn.format || f.sample_rate != fIn.sample_rate) { - throw std::invalid_argument("Can't mix frames with different formats"); + throw std::invalid_argument("Unable to mix frames with different formats"); } if (f.nb_samples == 0) { reserve(fIn.nb_samples); jami::libav_utils::fillWithSilence(&f); } else if (f.nb_samples != fIn.nb_samples) { - throw std::invalid_argument("Can't mix frames with different length"); + throw std::invalid_argument("Unable to mix frames with different length"); } AVSampleFormat fmt = (AVSampleFormat) f.format; bool isPlanar = av_sample_fmt_is_planar(fmt); @@ -365,7 +365,7 @@ getNewFrame(std::string_view id) { if (auto input = jami::Manager::instance().getVideoManager().getVideoInput(id)) return &input->getNewFrame(); - JAMI_WARN("getNewFrame: can't find input %.*s", (int) id.size(), id.data()); + JAMI_WARN("getNewFrame: Unable to find input %.*s", (int) id.size(), id.data()); return nullptr; } @@ -374,7 +374,7 @@ publishFrame(std::string_view id) { if (auto input = jami::Manager::instance().getVideoManager().getVideoInput(id)) return input->publishFrame(); - JAMI_WARN("publishFrame: can't find input %.*s", (int) id.size(), id.data()); + JAMI_WARN("publishFrame: Unable to find input %.*s", (int) id.size(), id.data()); } void @@ -509,7 +509,7 @@ stopLocalRecorder(const std::string& filepath) { jami::LocalRecorder* rec = jami::LocalRecorderManager::instance().getRecorderByPath(filepath); if (!rec) { - JAMI_WARN("Can't stop non existing local recorder."); + JAMI_WARN("Unable to stop non existing local recorder."); return; } diff --git a/src/conference.cpp b/src/conference.cpp index d83b44e0e3f0be4e9f0b650c4b5bd02ccf1f5ce8..74b76f3713792d6fe6232e4b455f72280716fb7c 100644 --- a/src/conference.cpp +++ b/src/conference.cpp @@ -130,7 +130,7 @@ Conference::Conference(const std::shared_ptr<Account>& account, // TODO: this is a first version, we assume that the peer is not // a master of a conference and there is only one remote // In the future, we should retrieve confInfo from the call - // To merge layouts informations + // To merge layout information isModeratorMuted = shared->isMuted(streamId); if (auto videoMixer = shared->videoMixer_) active = videoMixer->verifyActive(streamId); @@ -1128,7 +1128,7 @@ Conference::onConfOrder(const std::string& callId, const std::string& confOrder) Json::CharReaderBuilder rbuilder; auto reader = std::unique_ptr<Json::CharReader>(rbuilder.newCharReader()); if (!reader->parse(confOrder.c_str(), confOrder.c_str() + confOrder.size(), &root, &err)) { - JAMI_WARN("Couldn't parse conference order from %s", peerId.c_str()); + JAMI_WARN("Unable to parse conference order from %s", peerId.c_str()); return; } @@ -1532,7 +1532,7 @@ Conference::hangupParticipant(const std::string& accountUri, const std::string& // Else, it may be a remote host auto remoteHost = findHostforRemoteParticipant(accountUri, deviceId); if (remoteHost.empty()) { - JAMI_WARN("Can't hangup %s, peer not found", accountUri.c_str()); + JAMI_WARN("Unable to hangup %s, peer not found", accountUri.c_str()); return; } if (auto call = getCallFromPeerID(string_remove_suffix(remoteHost, '@'))) { @@ -1567,24 +1567,24 @@ Conference::muteLocalHost(bool is_muted, const std::string& mediaType) } else if (mediaType.compare(libjami::Media::Details::MEDIA_TYPE_VIDEO) == 0) { #ifdef ENABLE_VIDEO if (not isVideoEnabled()) { - JAMI_ERR("Cant't mute, the video is disabled!"); + JAMI_ERR("Unable to stop camera, the camera is disabled!"); return; } if (is_muted == isMediaSourceMuted(MediaType::MEDIA_VIDEO)) { - JAMI_DEBUG("Local video source already in [{:s}] state", - is_muted ? "muted" : "un-muted"); + JAMI_DEBUG("Local camera source already in [{:s}] state", + is_muted ? "stopped" : "started"); return; } setLocalHostMuteState(MediaType::MEDIA_VIDEO, is_muted); if (is_muted) { if (auto mixer = videoMixer_) { - JAMI_DBG("Muting local video sources"); + JAMI_DBG("Stopping local camera sources"); mixer->stopInputs(); } } else { if (auto mixer = videoMixer_) { - JAMI_DBG("Un-muting local video sources"); + JAMI_DBG("Starting local camera sources"); std::vector<std::string> videoInputs; for (const auto& source : hostSources_) { if (source.type_ == MediaType::MEDIA_VIDEO) @@ -1617,7 +1617,7 @@ Conference::resizeRemoteParticipants(ConfInfo& confInfo, std::string_view peerUR remoteFrameHeight = recv->getHeight(); remoteFrameWidth = recv->getWidth(); // NOTE: this may be not the behavior we want, but this is only called - // when we receive conferences informations from a call, so the peer is + // when we receive conferences information from a call, so the peer is // mixing the video and send only one stream, so we can break here break; } diff --git a/src/config/yamlparser.h b/src/config/yamlparser.h index 34b1221099f9215fed4d90367a935593217cf8e4..71357dbf1be8d288a31edd66f3f73bfb1cbe56e7 100644 --- a/src/config/yamlparser.h +++ b/src/config/yamlparser.h @@ -46,7 +46,7 @@ parseValueOptional(const YAML::Node& node, const char* key, T& value) parseValue(node, key, value); return true; } catch (const std::exception& e) { - // JAMI_DBG("Can't read yaml field: %s", key); + // JAMI_DBG("Unable to read yaml field: %s", key); } return false; } diff --git a/src/connectivity/security/tlsvalidator.cpp b/src/connectivity/security/tlsvalidator.cpp index 63d0d8f4899e86face19e22b00df676d1d09be7b..09778035bf15747d0725809958e1825e2b2dac7d 100644 --- a/src/connectivity/security/tlsvalidator.cpp +++ b/src/connectivity/security/tlsvalidator.cpp @@ -276,7 +276,7 @@ TlsValidator::TlsValidator(const dhtnet::tls::CertificateStore& certStore, const certificateContent_ = x509crt_->getPacked(); certificateFound_ = true; } catch (const std::exception& e) { - throw TlsValidatorException("Can't load certificate"); + throw TlsValidatorException("Unable to load certificate"); } } @@ -290,7 +290,7 @@ TlsValidator::TlsValidator(const dhtnet::tls::CertificateStore& certStore, const x509crt_ = crt; certificateContent_ = x509crt_->getPacked(); } catch (const std::exception& e) { - throw TlsValidatorException("Can't load certificate"); + throw TlsValidatorException("Unable to load certificate"); } } @@ -551,7 +551,7 @@ int TlsValidator::verifyHostnameCertificate(const std::string& host, const uint1 /* Create the socket. */ sockfd = socket (PF_INET, SOCK_STREAM, 0); if (sockfd < 0) { - JAMI_ERR("Could not create socket."); + JAMI_ERR("Unable to create socket."); return res; } /* Set non-blocking so we can dected timeouts. */ @@ -584,7 +584,7 @@ int TlsValidator::verifyHostnameCertificate(const std::string& host, const uint1 tv.tv_usec = 0; err = select(sockfd + 1, nullptr, &fdset, nullptr, &tv); if (err < 0 && errno != EINTR) { - JAMI_ERR("Could not connect to hostname %s at port %d", + JAMI_ERR("Unable to connect to hostname %s at port %d", host.c_str(), port); goto out; } else if (err > 0) { @@ -604,7 +604,7 @@ int TlsValidator::verifyHostnameCertificate(const std::string& host, const uint1 } } while(1); } else { - JAMI_ERR("Could not connect to hostname %s at port %d", host.c_str(), port); + JAMI_ERR("Unable to connect to hostname %s at port %d", host.c_str(), port); goto out; } } @@ -619,7 +619,7 @@ int TlsValidator::verifyHostnameCertificate(const std::string& host, const uint1 /* Disable Nagle algorithm that slows down the SSL handshake. */ err = setsockopt(sockfd, IPPROTO_TCP, TCP_NODELAY, &one, sizeof(one)); if (err < 0) { - JAMI_ERR("Could not set TCP_NODELAY."); + JAMI_ERR("Unable to set TCP_NODELAY."); goto out; } @@ -627,33 +627,33 @@ int TlsValidator::verifyHostnameCertificate(const std::string& host, const uint1 /* Load the trusted CA certificates. */ err = gnutls_certificate_allocate_credentials(&cred); if (err != GNUTLS_E_SUCCESS) { - JAMI_ERR("Could not allocate credentials - %s", gnutls_strerror(err)); + JAMI_ERR("Unable to allocate credentials - %s", gnutls_strerror(err)); goto out; } err = gnutls_certificate_set_x509_system_trust(cred); if (err != GNUTLS_E_SUCCESS) { - JAMI_ERR("Could not load credentials."); + JAMI_ERR("Unable to load credentials."); goto out; } /* Create the session object. */ err = gnutls_init(&session, GNUTLS_CLIENT); if (err != GNUTLS_E_SUCCESS) { - JAMI_ERR("Could not init session -%s\n", gnutls_strerror(err)); + JAMI_ERR("Unable to init session -%s\n", gnutls_strerror(err)); goto out; } /* Configure the cipher preferences. The default set should be good enough. */ err = gnutls_priority_set_direct(session, "NORMAL", &errptr); if (err != GNUTLS_E_SUCCESS) { - JAMI_ERR("Could not set up ciphers - %s (%s)", gnutls_strerror(err), errptr); + JAMI_ERR("Unable to set up ciphers - %s (%s)", gnutls_strerror(err), errptr); goto out; } /* Install the trusted certificates. */ err = gnutls_credentials_set(session, GNUTLS_CRD_CERTIFICATE, cred); if (err != GNUTLS_E_SUCCESS) { - JAMI_ERR("Could not set up credentials - %s", gnutls_strerror(err)); + JAMI_ERR("Unable to set up credentials - %s", gnutls_strerror(err)); goto out; } @@ -661,7 +661,7 @@ int TlsValidator::verifyHostnameCertificate(const std::string& host, const uint1 gnutls_transport_set_ptr(session, (gnutls_transport_ptr_t) (uintptr_t) sockfd); err = gnutls_server_name_set(session, GNUTLS_NAME_DNS, host.c_str(), host.size()); if (err != GNUTLS_E_SUCCESS) { - JAMI_ERR("Could not set server name - %s", gnutls_strerror(err)); + JAMI_ERR("Unable to set server name - %s", gnutls_strerror(err)); goto out; } @@ -675,14 +675,14 @@ int TlsValidator::verifyHostnameCertificate(const std::string& host, const uint1 * itself is stored in the first element of the array. */ certs = gnutls_certificate_get_peers(session, &certslen); if (certs == nullptr || certslen == 0) { - JAMI_ERR("Could not obtain peer certificate - %s", gnutls_strerror(err)); + JAMI_ERR("Unable to obtain peer certificate - %s", gnutls_strerror(err)); goto out; } /* Validate the certificate chain. */ err = gnutls_certificate_verify_peers2(session, &status); if (err != GNUTLS_E_SUCCESS) { - JAMI_ERR("Could not verify the certificate chain - %s", gnutls_strerror(err)); + JAMI_ERR("Unable to verify the certificate chain - %s", gnutls_strerror(err)); goto out; } if (status != 0) { @@ -710,7 +710,7 @@ int TlsValidator::verifyHostnameCertificate(const std::string& host, const uint1 err = gnutls_x509_crt_init(&cert); if (err != GNUTLS_E_SUCCESS) { - JAMI_ERR("Could not init certificate - %s", gnutls_strerror(err)); + JAMI_ERR("Unable to init certificate - %s", gnutls_strerror(err)); goto out; } @@ -719,7 +719,7 @@ int TlsValidator::verifyHostnameCertificate(const std::string& host, const uint1 if (err != GNUTLS_E_SUCCESS) err = gnutls_x509_crt_import(cert, certs, GNUTLS_X509_FMT_DER); if (err != GNUTLS_E_SUCCESS) { - JAMI_ERR("Could not read peer certificate - %s", gnutls_strerror(err)); + JAMI_ERR("Unable to read peer certificate - %s", gnutls_strerror(err)); goto out; } /* Finally check if the hostnames match. */ diff --git a/src/connectivity/utf8_utils.cpp b/src/connectivity/utf8_utils.cpp index 7b3ba20fb0cfdabd3b6a9b148f3f43b39def15c4..acadc86a8c44916fa5bfb0f1c79b4df26fa0e565 100644 --- a/src/connectivity/utf8_utils.cpp +++ b/src/connectivity/utf8_utils.cpp @@ -46,7 +46,7 @@ using ssize_t = SSIZE_T; * Check whether a Unicode (5.2) char is in a valid range. * * The first check comes from the Unicode guarantee to never encode - * a point above 0x0010ffff, since UTF-16 couldn't represent it. + * a point above 0x0010ffff, since UTF-16 is unable to represent it. * * The second check covers surrogate pairs (category Cs). * diff --git a/src/fileutils.cpp b/src/fileutils.cpp index d159a0394427ad62e626c6b9cc4f81af811aa821..b63563a2b2524fc9c556005a1993ddcfb3317a37 100644 --- a/src/fileutils.cpp +++ b/src/fileutils.cpp @@ -190,7 +190,7 @@ createSymlink(const std::filesystem::path& linkFile, const std::filesystem::path std::error_code ec; std::filesystem::create_symlink(target, linkFile, ec); if (ec) { - JAMI_WARNING("Couldn't create soft link from {} to {}: {}", linkFile, target, ec.message()); + JAMI_WARNING("Unable to create soft link from {} to {}: {}", linkFile, target, ec.message()); return false; } else { JAMI_LOG("Created soft link from {} to {}", linkFile, target); @@ -204,7 +204,7 @@ createHardlink(const std::filesystem::path& linkFile, const std::filesystem::pat std::error_code ec; std::filesystem::create_hard_link(target, linkFile, ec); if (ec) { - JAMI_WARNING("Couldn't create hard link from {} to {}: {}", linkFile, target, ec.message()); + JAMI_WARNING("Unable to create hard link from {} to {}: {}", linkFile, target, ec.message()); return false; } else { JAMI_LOG("Created hard link from {} to {}", linkFile, target); @@ -277,7 +277,7 @@ loadTextFile(const std::filesystem::path& path, const std::filesystem::path& def std::string buffer; std::ifstream file(getFullPath(default_dir, path)); if (!file) - throw std::runtime_error("Can't read file: " + path.string()); + throw std::runtime_error("Unable to read file: " + path.string()); file.seekg(0, std::ios::end); auto size = file.tellg(); if (size > std::numeric_limits<unsigned>::max()) @@ -285,7 +285,7 @@ loadTextFile(const std::filesystem::path& path, const std::filesystem::path& def buffer.resize(size); file.seekg(0, std::ios::beg); if (!file.read((char*) buffer.data(), size)) - throw std::runtime_error("Can't load file: " + path.string()); + throw std::runtime_error("Unable to load file: " + path.string()); return buffer; } @@ -297,7 +297,7 @@ saveFile(const std::filesystem::path& path, { std::ofstream file(path, std::ios::trunc | std::ios::binary); if (!file.is_open()) { - JAMI_ERROR("Could not write data to {}", path); + JAMI_ERROR("Unable to write data to {}", path); return; } file.write((char*) data, data_size); @@ -576,7 +576,7 @@ get_config_dir(const char* pkg) if (!dhtnet::fileutils::recursive_mkdir(configdir, 0700)) { // If directory creation failed if (errno != EEXIST) - JAMI_DBG("Cannot create directory: %s!", configdir.c_str()); + JAMI_DBG("Unable to create directory: %s!", configdir.c_str()); } return configdir; } @@ -599,13 +599,13 @@ eraseFile_win32(const std::string& path, bool dosync) HANDLE h = CreateFileA(path.c_str(), GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); if (h == INVALID_HANDLE_VALUE) { - JAMI_WARN("Can not open file %s for erasing.", path.c_str()); + JAMI_WARN("Unable to open file %s for erasing.", path.c_str()); return false; } LARGE_INTEGER size; if (!GetFileSizeEx(h, &size)) { - JAMI_WARN("Can not erase file %s: GetFileSizeEx() failed.", path.c_str()); + JAMI_WARN("Unable to erase file %s: GetFileSizeEx() failed.", path.c_str()); CloseHandle(h); return false; } @@ -622,7 +622,7 @@ eraseFile_win32(const std::string& path, bool dosync) try { buffer = new char[ERASE_BLOCK]; } catch (std::bad_alloc& ba) { - JAMI_WARN("Can not allocate buffer for erasing %s.", path.c_str()); + JAMI_WARN("Unable to allocate buffer for erasing %s.", path.c_str()); CloseHandle(h); return false; } @@ -658,7 +658,7 @@ eraseFile_posix(const std::string& path, bool dosync) { struct stat st; if (stat(path.c_str(), &st) == -1) { - JAMI_WARN("Can not erase file %s: fstat() failed.", path.c_str()); + JAMI_WARN("Unable to erase file %s: fstat() failed.", path.c_str()); return false; } // Remove read-only flag if possible @@ -666,7 +666,7 @@ eraseFile_posix(const std::string& path, bool dosync) int fd = open(path.c_str(), O_WRONLY); if (fd == -1) { - JAMI_WARN("Can not open file %s for erasing.", path.c_str()); + JAMI_WARN("Unable to open file %s for erasing.", path.c_str()); return false; } diff --git a/src/gittransport.cpp b/src/gittransport.cpp index cd02b9dfd3abb9a0943362cf3ac34682c0f82a73..c7cb4d887eeea0ccfa653691fcb8553abdd07f64 100644 --- a/src/gittransport.cpp +++ b/src/gittransport.cpp @@ -183,7 +183,7 @@ P2PSubTransportAction(git_smart_subtransport_stream** out, if (action == GIT_SERVICE_UPLOADPACK_LS) { auto gitSocket = jami::Manager::instance().gitSocket(accountId, deviceId, conversationId); if (!gitSocket) { - JAMI_ERROR("Can't find related socket for {:s}, {:s}, {:s}", + JAMI_ERROR("Unable to find related socket for {:s}, {:s}, {:s}", accountId, deviceId, conversationId); diff --git a/src/im/message_engine.cpp b/src/im/message_engine.cpp index 37ad1a088fbd9f066bc5c7ed36888e53fecc35b1..dab2e6a6841433219dae7f63ea3655d535ea8a11 100644 --- a/src/im/message_engine.cpp +++ b/src/im/message_engine.cpp @@ -196,7 +196,7 @@ MessageEngine::onMessageSent(const std::string& peer, JAMI_DEBUG("[message {:d}] State is not SENDING", token); } } else { - JAMI_DEBUG("[message {:d}] Can't find message", token); + JAMI_DEBUG("[message {:d}] Unable to find message", token); } } @@ -227,13 +227,13 @@ MessageEngine::load() std::lock_guard lock(messagesMutex_); messages_ = std::move(root); if (not messages_.empty()) { - JAMI_LOG("[Account {}] loaded {} messages from {}", + JAMI_LOG("[Account {}] Loaded {} messages from {}", account_.getAccountID(), messages_.size(), savePath_); } } catch (const std::exception& e) { - JAMI_LOG("[Account {}] couldn't load messages from {}: {}", + JAMI_LOG("[Account {}] Unable to load messages from {}: {}", account_.getAccountID(), savePath_, e.what()); @@ -268,7 +268,7 @@ MessageEngine::save_() const if (file.is_open()) msgpack::pack(file, messages_); } catch (const std::exception& e) { - JAMI_ERROR("[Account {}] couldn't serialize pending messages: {}", + JAMI_ERROR("[Account {}] Unable to serialize pending messages: {}", account_.getAccountID(), e.what()); } } diff --git a/src/jamidht/account_manager.cpp b/src/jamidht/account_manager.cpp index 50d4a44582d5008400cb6accf74e12f442d8e1c5..0b6e3ffa575c9a57255389a1a7b7e9de84f27478 100644 --- a/src/jamidht/account_manager.cpp +++ b/src/jamidht/account_manager.cpp @@ -166,7 +166,7 @@ AccountManager::parseAnnounce(const std::string& announceBase64, return {}; } } catch (const std::exception& e) { - JAMI_ERR("[Auth] can't read announce: %s", e.what()); + JAMI_ERR("[Auth] unable to read announce: %s", e.what()); return {}; } return announce_val; @@ -199,7 +199,7 @@ AccountManager::useIdentity(const std::string& accountId, auto contactList = std::make_unique<ContactList>(accountId, accountCertificate, path_, onChange); auto result = contactList->isValidAccountDevice(*identity.second); if (not result) { - JAMI_ERR("[Auth] can't use identity: device certificate chain can't be verified: %s", + JAMI_ERR("[Auth] unable to use identity: device certificate chain is unable to be verified: %s", result.toString().c_str()); return nullptr; } @@ -323,7 +323,7 @@ AccountManager::startSync(const OnNewDeviceCb& cb, const OnDeviceAnnouncedCb& dc }); syncDevices(); } else { - JAMI_WARNING("can't announce device: no announcement..."); + JAMI_WARNING("Unable to announce device: no announcement..."); } auto inboxKey = dht::InfoHash::get("inbox:" + info_->devicePk->getId().toString()); @@ -414,7 +414,7 @@ AccountManager::foundPeerDevice(const std::shared_ptr<dht::crypto::Certificate>& while (top_issuer->issuer) top_issuer = top_issuer->issuer; - // Device certificate can't be self-signed + // Device certificate is unable to be self-signed if (top_issuer == crt) { JAMI_WARN("Found invalid peer device: %s", crt->getLongId().toString().c_str()); return false; @@ -711,7 +711,7 @@ AccountManager::sendTrustRequest(const std::string& to, JAMI_WARN("AccountManager::sendTrustRequest"); auto toH = dht::InfoHash(to); if (not toH) { - JAMI_ERR("can't send trust request to invalid hash: %s", to.c_str()); + JAMI_ERR("Unable to send trust request to invalid hash: %s", to.c_str()); return; } if (not info_) { diff --git a/src/jamidht/accountarchive.cpp b/src/jamidht/accountarchive.cpp index d26da419754b517ac90c8639646608e1de35ce9b..e14b8d55195406272b1e30a19fcac9655c2e40ce 100644 --- a/src/jamidht/accountarchive.cpp +++ b/src/jamidht/accountarchive.cpp @@ -94,13 +94,13 @@ AccountArchive::deserialize(const std::vector<uint8_t>& dat, const std::vector<u config[key] = itr->asString(); } } catch (const std::exception& ex) { - JAMI_ERR("Can't parse JSON entry with value of type %d: %s", + JAMI_ERR("Unable to parse JSON entry with value of type %d: %s", (unsigned) itr->type(), ex.what()); } } } catch (const std::exception& ex) { - JAMI_ERR("Can't parse JSON: %s", ex.what()); + JAMI_ERR("Unable to parse JSON: %s", ex.what()); } if (not id.first) { diff --git a/src/jamidht/archive_account_manager.cpp b/src/jamidht/archive_account_manager.cpp index f349eca85d77f9e148faa713036b76f182f33f34..1185ac8fdacc76ce71db1faf1289181c5885c04b 100644 --- a/src/jamidht/archive_account_manager.cpp +++ b/src/jamidht/archive_account_manager.cpp @@ -91,7 +91,7 @@ ArchiveAccountManager::initAuthentication(const std::string& accountId, auto future_keypair = dht::ThreadPool::computation().get<dev::KeyPair>( &dev::KeyPair::create); AccountArchive a; - JAMI_WARN("[Auth] converting certificate from old account %s", + JAMI_WARN("[Auth] Converting certificate from old account %s", ctx->credentials->updateIdentity.first->getPublicKey() .getId() .toString() @@ -219,13 +219,13 @@ ArchiveAccountManager::createAccount(AuthContext& ctx) AccountArchive a; auto ca = dht::crypto::generateIdentity("Jami CA"); if (!ca.first || !ca.second) { - throw std::runtime_error("Can't generate CA for this account."); + throw std::runtime_error("Unable to generate CA for this account."); } a.id = dht::crypto::generateIdentity("Jami", ca, 4096, true); if (!a.id.first || !a.id.second) { - throw std::runtime_error("Can't generate identity for this account."); + throw std::runtime_error("Unable to generate identity for this account."); } - JAMI_WARN("[Auth] new account: CA: %s, ID: %s", + JAMI_WARN("[Auth] New account: CA: %s, ID: %s", ca.second->getId().toString().c_str(), a.id.second->getId().toString().c_str()); a.ca_key = ca.first; @@ -237,12 +237,12 @@ ArchiveAccountManager::createAccount(AuthContext& ctx) void ArchiveAccountManager::loadFromFile(AuthContext& ctx) { - JAMI_WARN("[Auth] loading archive from: %s", ctx.credentials->uri.c_str()); + JAMI_WARN("[Auth] Loading archive from: %s", ctx.credentials->uri.c_str()); AccountArchive archive; try { archive = AccountArchive(ctx.credentials->uri, ctx.credentials->password_scheme, ctx.credentials->password); } catch (const std::exception& ex) { - JAMI_WARN("[Auth] can't read file: %s", ex.what()); + JAMI_WARN("[Auth] Unable to read file: %s", ex.what()); ctx.onFailure(AuthError::INVALID_ARGUMENTS, ex.what()); return; } @@ -273,7 +273,7 @@ ArchiveAccountManager::loadFromDHT(const std::shared_ptr<AuthContext>& ctx) dht::ThreadPool::computation().run( [ctx, network_error = !s.stateOld.second && !s.stateNew.second] { ctx->dhtContext.reset(); - JAMI_WARN("[Auth] failure looking for archive on DHT: %s", + JAMI_WARN("[Auth] Failure looking for archive on DHT: %s", /**/ network_error ? "network error" : "not found"); ctx->onFailure(network_error ? AuthError::NETWORK : AuthError::UNKNOWN, ""); }); @@ -290,7 +290,7 @@ ArchiveAccountManager::loadFromDHT(const std::shared_ptr<AuthContext>& ctx) std::tie(key, loc) = computeKeys(ctx->credentials->password, ctx->credentials->uri, previous); - JAMI_DBG("[Auth] trying to load account from DHT with %s at %s", + JAMI_DBG("[Auth] Attempting to load account from DHT with %s at %s", /**/ ctx->credentials->uri.c_str(), loc.toString().c_str()); if (not ctx->dhtContext or ctx->dhtContext->found) { @@ -305,7 +305,7 @@ ArchiveAccountManager::loadFromDHT(const std::shared_ptr<AuthContext>& ctx) } catch (const std::exception& ex) { return true; } - JAMI_DBG("[Auth] found archive on the DHT"); + JAMI_DBG("[Auth] Found archive on the DHT"); ctx->dhtContext->found = true; dht::ThreadPool::computation().run([ctx, decrypted = std::move(decrypted), w] { @@ -346,12 +346,12 @@ ArchiveAccountManager::loadFromDHT(const std::shared_ptr<AuthContext>& ctx) void ArchiveAccountManager::migrateAccount(AuthContext& ctx) { - JAMI_WARN("[Auth] account migration needed"); + JAMI_WARN("[Auth] Account migration needed"); AccountArchive archive; try { archive = readArchive(ctx.credentials->password_scheme, ctx.credentials->password); } catch (...) { - JAMI_DBG("[Auth] Can't load archive"); + JAMI_DBG("[Auth] Unable to load archive"); ctx.onFailure(AuthError::INVALID_ARGUMENTS, ""); return; } @@ -376,7 +376,7 @@ ArchiveAccountManager::onArchiveLoaded(AuthContext& ctx, a.save(fileutils::getFullPath(path_, archivePath_), ctx.credentials ? ctx.credentials->password_scheme : "", ctx.credentials ? ctx.credentials->password : ""); if (not a.id.second->isCA()) { - JAMI_ERR("[Auth] trying to sign a certificate with a non-CA."); + JAMI_ERR("[Auth] Attempting to sign a certificate with a non-CA."); } std::shared_ptr<dht::crypto::Certificate> deviceCertificate; @@ -397,7 +397,7 @@ ArchiveAccountManager::onArchiveLoaded(AuthContext& ctx, // Generate a new device if needed if (!deviceCertificate) { - JAMI_WARN("[Auth] creating new device certificate"); + JAMI_WARN("[Auth] Creating new device certificate"); auto request = ctx.request.get(); if (not request->verify()) { JAMI_ERR("[Auth] Invalid certificate request."); @@ -406,7 +406,7 @@ ArchiveAccountManager::onArchiveLoaded(AuthContext& ctx, } deviceCertificate = std::make_shared<dht::crypto::Certificate>( dht::crypto::Certificate::generate(*request, a.id)); - JAMI_WARNING("[Auth] created new device: {}", + JAMI_WARNING("[Auth] Created new device: {}", deviceCertificate->getLongId()); } @@ -473,7 +473,7 @@ ArchiveAccountManager::makeReceipt(const dht::crypto::Identity& id, const dht::crypto::Certificate& device, const std::string& ethAccount) { - JAMI_DBG("[Auth] signing device receipt"); + JAMI_DBG("[Auth] Signing device receipt"); auto devId = device.getId(); DeviceAnnouncement announcement; announcement.dev = devId; @@ -482,7 +482,7 @@ ArchiveAccountManager::makeReceipt(const dht::crypto::Identity& id, ann_val.sign(*id.first); auto packedAnnoucement = ann_val.getPacked(); - JAMI_DBG("[Auth] device announcement size: %zu", packedAnnoucement.size()); + JAMI_DBG("[Auth] Device announcement size: %zu", packedAnnoucement.size()); std::ostringstream is; is << "{\"id\":\"" << id.second->getId() << "\",\"dev\":\"" << devId << "\",\"eth\":\"" @@ -527,7 +527,7 @@ ArchiveAccountManager::syncDevices() if (dev.first.toString() == info_->deviceId) continue; if (!dev.second.certificate) { - JAMI_WARNING("Cannot find certificate for {}", dev.first); + JAMI_WARNING("Unable to find certificate for {}", dev.first); continue; } auto pk = dev.second.certificate->getSharedPublicKey(); @@ -553,7 +553,7 @@ ArchiveAccountManager::startSync(const OnNewDeviceCb& cb, const OnDeviceAnnounce [this, sync](const std::shared_ptr<dht::crypto::Certificate>& cert) mutable { if (!cert or cert->getId() != sync.from) { - JAMI_WARN("Can't find certificate for device %s", + JAMI_WARN("Unable to find certificate for device %s", sync.from.toString().c_str()); return; } @@ -569,7 +569,7 @@ ArchiveAccountManager::startSync(const OnNewDeviceCb& cb, const OnDeviceAnnounce AccountArchive ArchiveAccountManager::readArchive(std::string_view scheme, const std::string& pwd) const { - JAMI_DBG("[Auth] reading account archive"); + JAMI_DBG("[Auth] Reading account archive"); return AccountArchive(fileutils::getFullPath(path_, archivePath_), scheme, pwd); } @@ -595,7 +595,7 @@ ArchiveAccountManager::updateArchive(AccountArchive& archive) const TLS::CERTIFICATE_FILE, TLS::PRIVATE_KEY_FILE}; - JAMI_DBG("[Auth] building account archive"); + JAMI_DBG("[Auth] Building account archive"); for (const auto& it : onExportConfig_()) { // filter-out? if (std::any_of(std::begin(filtered_keys), std::end(filtered_keys), [&](const auto& key) { @@ -632,7 +632,7 @@ ArchiveAccountManager::saveArchive(AccountArchive& archive, std::string_view sch archivePath_ = "export.gz"; archive.save(fileutils::getFullPath(path_, archivePath_), scheme, pwd); } catch (const std::runtime_error& ex) { - JAMI_ERR("[Auth] Can't export archive: %s", ex.what()); + JAMI_ERR("[Auth] Unable to export archive: %s", ex.what()); return; } } @@ -694,7 +694,7 @@ ArchiveAccountManager::addDevice(const std::string& password, AddDeviceCallback std::string pin_str; AccountArchive a; try { - JAMI_DBG("[Auth] exporting account"); + JAMI_DBG("[Auth] Exporting account"); a = this_->readArchive("password", password); @@ -703,7 +703,7 @@ ArchiveAccountManager::addDevice(const std::string& password, AddDeviceCallback std::tie(key, loc) = computeKeys(password, pin_str); } catch (const std::exception& e) { - JAMI_ERR("[Auth] can't export account: %s", e.what()); + JAMI_ERR("[Auth] Unable to export account: %s", e.what()); cb(AddDeviceResult::ERROR_CREDENTIALS, {}); return; } @@ -714,19 +714,19 @@ ArchiveAccountManager::addDevice(const std::string& password, AddDeviceCallback auto encrypted = dht::crypto::aesEncrypt(archiver::compress(a.serialize()), key); if (not this_->dht_ or not this_->dht_->isRunning()) throw std::runtime_error("DHT is not running.."); - JAMI_WARN("[Auth] exporting account with PIN: %s at %s (size %zu)", + JAMI_WARN("[Auth] Exporting account with PIN: %s at %s (size %zu)", pin_str.c_str(), loc.toString().c_str(), encrypted.size()); this_->dht_->put(loc, encrypted, [cb, pin = std::move(pin_str)](bool ok) { - JAMI_DBG("[Auth] account archive published: %s", ok ? "success" : "failure"); + JAMI_DBG("[Auth] Account archive published: %s", ok ? "success" : "failure"); if (ok) cb(AddDeviceResult::SUCCESS_SHOW_PIN, pin); else cb(AddDeviceResult::ERROR_NETWORK, {}); }); } catch (const std::exception& e) { - JAMI_ERR("[Auth] can't export account: %s", e.what()); + JAMI_ERR("[Auth] Unable to export account: %s", e.what()); cb(AddDeviceResult::ERROR_NETWORK, {}); return; } @@ -794,10 +794,10 @@ ArchiveAccountManager::exportArchive(const std::string& destinationPath, std::st std::filesystem::copy_file(archivePath, destinationPath, std::filesystem::copy_options::overwrite_existing, ec); return !ec; } catch (const std::runtime_error& ex) { - JAMI_ERR("[Auth] Can't export archive: %s", ex.what()); + JAMI_ERR("[Auth] Unable to export archive: %s", ex.what()); return false; } catch (...) { - JAMI_ERR("[Auth] Can't export archive: can't read archive"); + JAMI_ERR("[Auth] Unable to export archive: Unable to read archive"); return false; } } @@ -837,7 +837,7 @@ ArchiveAccountManager::registerName(const std::string& name, privateKey->sign(std::vector<uint8_t>(nameLowercase.begin(), nameLowercase.end()))); ethAccount = dev::KeyPair(dev::Secret(archive.eth_key)).address().hex(); } catch (const std::exception& e) { - // JAMI_ERR("[Auth] can't export account: %s", e.what()); + // JAMI_ERR("[Auth] Unable to export account: %s", e.what()); cb(NameDirectory::RegistrationResponse::invalidCredentials, name); return; } diff --git a/src/jamidht/channeled_transport.cpp b/src/jamidht/channeled_transport.cpp index 937c48474e7f438458b7f5e7f5faed531a6d6851..9818090b1f40b0d82bb7c1283bae24802f2763c8 100644 --- a/src/jamidht/channeled_transport.cpp +++ b/src/jamidht/channeled_transport.cpp @@ -64,10 +64,10 @@ ChanneledSIPTransport::ChanneledSIPTransport(pjsip_endpoint* endpt, base.pool = pool_.get(); if (pj_atomic_create(pool_.get(), 0, &base.ref_cnt) != PJ_SUCCESS) - throw std::runtime_error("Can't create PJSIP atomic."); + throw std::runtime_error("Unable to create PJSIP atomic."); if (pj_lock_create_recursive_mutex(pool_.get(), "chan", &base.lock) != PJ_SUCCESS) - throw std::runtime_error("Can't create PJSIP mutex."); + throw std::runtime_error("Unable to create PJSIP mutex."); if (not local_) { JAMI_ERR("Invalid local address"); @@ -149,7 +149,7 @@ ChanneledSIPTransport::ChanneledSIPTransport(pjsip_endpoint* endpt, // Register callbacks if (pjsip_transport_register(base.tpmgr, &base) != PJ_SUCCESS) - throw std::runtime_error("Can't register PJSIP transport."); + throw std::runtime_error("Unable to register PJSIP transport."); } void diff --git a/src/jamidht/contact_list.cpp b/src/jamidht/contact_list.cpp index 502e79eb4809f7b6af03c8eb70f7462b2b050832..f096bd7011da807504222875dd66de397ddf7c65 100644 --- a/src/jamidht/contact_list.cpp +++ b/src/jamidht/contact_list.cpp @@ -69,7 +69,7 @@ ContactList::setCertificateStatus(const std::string& cert_id, const dhtnet::tls::TrustStore::PermissionStatus status) { if (contacts_.find(dht::InfoHash(cert_id)) != contacts_.end()) { - JAMI_DBG("Can't set certificate status for existing contacts %s", cert_id.c_str()); + JAMI_DBG("Unable to set certificate status for existing contacts %s", cert_id.c_str()); return false; } return trust_->setCertificateStatus(cert_id, status); @@ -162,7 +162,7 @@ ContactList::getContactDetails(const dht::InfoHash& h) const { const auto c = contacts_.find(h); if (c == std::end(contacts_)) { - JAMI_WARN("[Contacts] contact '%s' not found", h.to_c_str()); + JAMI_WARN("[Contacts] Contact '%s' not found", h.to_c_str()); return {}; } @@ -200,11 +200,11 @@ ContactList::updateContact(const dht::InfoHash& id, const Contact& contact, bool bool stateChanged {false}; auto c = contacts_.find(id); if (c == contacts_.end()) { - // JAMI_DBG("[Contacts] new contact: %s", id.toString().c_str()); + // JAMI_DBG("[Contacts] New contact: %s", id.toString().c_str()); c = contacts_.emplace(id, contact).first; stateChanged = c->second.isActive() or c->second.isBanned(); } else { - // JAMI_DBG("[Contacts] updated contact: %s", id.toString().c_str()); + // JAMI_DBG("[Contacts] Updated contact: %s", id.toString().c_str()); stateChanged = c->second.update(contact); } if (stateChanged) { @@ -238,7 +238,7 @@ ContactList::loadContacts() msgpack::object_handle oh = msgpack::unpack((const char*) file.data(), file.size()); oh.get().convert(contacts); } catch (const std::exception& e) { - JAMI_WARN("[Contacts] error loading contacts: %s", e.what()); + JAMI_WARN("[Contacts] Error loading contacts: %s", e.what()); return; } @@ -275,7 +275,7 @@ ContactList::loadTrustRequests() msgpack::object_handle oh = msgpack::unpack((const char*) file.data(), file.size()); oh.get().convert(requests); } catch (const std::exception& e) { - JAMI_WARN("[Contacts] error loading trust requests: %s", e.what()); + JAMI_WARN("[Contacts] Error loading trust requests: %s", e.what()); return; } @@ -437,9 +437,9 @@ ContactList::loadKnownDevices() for (const auto& d : knownDevices) { if (auto crt = jami::Manager::instance().certStore(accountId_).getCertificate(d.first.toString())) { if (not foundAccountDevice(crt, d.second.first, clock::from_time_t(d.second.second))) - JAMI_WARN("[Contacts] can't add device %s", d.first.toString().c_str()); + JAMI_WARN("[Contacts] Unable to add device %s", d.first.toString().c_str()); } else { - JAMI_WARN("[Contacts] can't find certificate for device %s", + JAMI_WARN("[Contacts] Unable to find certificate for device %s", d.first.toString().c_str()); } } @@ -455,11 +455,11 @@ ContactList::loadKnownDevices() if (not foundAccountDevice(crt, d.second.first, clock::from_time_t(d.second.second))) - JAMI_WARN("[Contacts] can't add device %s", d.first.toString().c_str()); + JAMI_WARN("[Contacts] Unable to add device %s", d.first.toString().c_str()); } } } catch (const std::exception& e) { - JAMI_WARN("[Contacts] error loading devices: %s", e.what()); + JAMI_WARN("[Contacts] Error loading devices: %s", e.what()); } return; } @@ -492,7 +492,7 @@ ContactList::foundAccountDevice(const dht::PkId& device, } else { // update device name if (not name.empty() and it.first->second.name != name) { - JAMI_DBG("[Contacts] updating device name: %s %s", + JAMI_DBG("[Contacts] Updating device name: %s %s", name.c_str(), device.toString().c_str()); it.first->second.name = name; @@ -538,7 +538,7 @@ ContactList::foundAccountDevice(const std::shared_ptr<dht::crypto::Certificate>& } else { // update device name if (not name.empty() and it.first->second.name != name) { - JAMI_DBG("[Contacts] updating device name: %s %s", name.c_str(), id.to_c_str()); + JAMI_DBG("[Contacts] Updating device name: %s %s", name.c_str(), id.to_c_str()); it.first->second.name = name; saveKnownDevices(); callbacks_.devicesChanged(knownDevices_); @@ -629,11 +629,11 @@ ContactList::syncDevice(const dht::PkId& device, const time_point& syncDate) { auto it = knownDevices_.find(device); if (it == knownDevices_.end()) { - JAMI_WARN("[Contacts] dropping sync data from unknown device"); + JAMI_WARN("[Contacts] Dropping sync data from unknown device"); return false; } if (it->second.last_sync >= syncDate) { - JAMI_DBG("[Contacts] dropping outdated sync data"); + JAMI_DBG("[Contacts] Dropping outdated sync data"); return false; } it->second.last_sync = syncDate; diff --git a/src/jamidht/conversation.cpp b/src/jamidht/conversation.cpp index fad842a02d2e59a4ed0aeaaf46e18fa9b25e0806..313a81dadfab2fa75d08342c69460c3d9a983a63 100644 --- a/src/jamidht/conversation.cpp +++ b/src/jamidht/conversation.cpp @@ -144,7 +144,7 @@ public: , deviceId_(account->currentDeviceId()) { if (!repository_) { - throw std::logic_error("Couldn't create repository"); + throw std::logic_error("Unable to create repository"); } init(account); } @@ -157,7 +157,7 @@ public: { repository_ = std::make_unique<ConversationRepository>(account, conversationId); if (!repository_) { - throw std::logic_error("Couldn't create repository"); + throw std::logic_error("Unable to create repository"); } init(account); } @@ -179,8 +179,8 @@ public: }); if (!repository_) { emitSignal<libjami::ConversationSignal::OnConversationError>( - accountId_, conversationId, EFETCH, "Couldn't clone repository"); - throw std::logic_error("Couldn't clone repository"); + accountId_, conversationId, EFETCH, "Unable to clone repository"); + throw std::logic_error("Unable to clone repository"); } // To detect current active calls, we need to check history conversationDataPath_ = fileutils::get_data_dir() / accountId_ @@ -1192,18 +1192,18 @@ Conversation::addMember(const std::string& contactUri, const OnDoneCb& cb) auto initialMembers = getInitialMembers(); auto it = std::find(initialMembers.begin(), initialMembers.end(), contactUri); if (it == initialMembers.end()) { - JAMI_WARN("Cannot add new member in one to one conversation"); + JAMI_WARN("Unable to add new member in one to one conversation"); cb(false, ""); return; } } } catch (const std::exception& e) { - JAMI_WARN("Cannot get mode: %s", e.what()); + JAMI_WARN("Unable to get mode: %s", e.what()); cb(false, ""); return; } if (isMember(contactUri, true)) { - JAMI_WARN("Could not add member %s because it's already a member", contactUri.c_str()); + JAMI_WARN("Unable to add member %s because it's already a member", contactUri.c_str()); cb(false, ""); return; } @@ -1222,7 +1222,7 @@ Conversation::addMember(const std::string& contactUri, const OnDoneCb& cb) } }); } else { - JAMI_WARN("Could not add member %s because this member is banned", contactUri.c_str()); + JAMI_WARN("Unable to add member %s because this member is blocked", contactUri.c_str()); cb(false, ""); } return; @@ -1304,7 +1304,7 @@ Conversation::Impl::voteUnban(const std::string& contactUri, { // Check if admin if (!isAdmin()) { - JAMI_WARN("You're not an admin of this repo. Cannot unban %s", contactUri.c_str()); + JAMI_WARN("You're not an admin of this repo. Unable to unblock %s", contactUri.c_str()); cb(false, {}); return; } @@ -1345,7 +1345,7 @@ Conversation::removeMember(const std::string& contactUri, bool isDevice, const O if (auto sthis = w.lock()) { // Check if admin if (!sthis->pimpl_->isAdmin()) { - JAMI_WARN("You're not an admin of this repo. Cannot ban %s", contactUri.c_str()); + JAMI_WARN("You're not an admin of this repo. Unable to block %s", contactUri.c_str()); cb(false, {}); return; } @@ -1634,7 +1634,7 @@ Conversation::Impl::mergeHistory(const std::string& uri) } auto remoteHead = repository_->remoteHead(uri); if (remoteHead.empty()) { - JAMI_WARN("Could not get HEAD of %s", uri.c_str()); + JAMI_WARN("Unable to get HEAD of %s", uri.c_str()); return {}; } @@ -1642,7 +1642,7 @@ Conversation::Impl::mergeHistory(const std::string& uri) auto [newCommits, err] = repository_->validFetch(uri); if (newCommits.empty()) { if (err) - JAMI_ERR("Could not validate history with %s", uri.c_str()); + JAMI_ERR("Unable to validate history with %s", uri.c_str()); repository_->removeBranchWith(uri); return {}; } @@ -1650,7 +1650,7 @@ Conversation::Impl::mergeHistory(const std::string& uri) // If validated, merge auto [ok, cid] = repository_->merge(remoteHead); if (!ok) { - JAMI_ERR("Could not merge history with %s", uri.c_str()); + JAMI_ERR("Unable to merge history with %s", uri.c_str()); repository_->removeBranchWith(uri); return {}; } diff --git a/src/jamidht/conversation.h b/src/jamidht/conversation.h index 6e3a0bd9d8677af86622a3f067e94007b057cba1..cd99b4100ea1bb87ad040c2d5f42997e0e814d5e 100644 --- a/src/jamidht/conversation.h +++ b/src/jamidht/conversation.h @@ -441,11 +441,11 @@ public: std::size_t end = 0); /** - * Reset fetched informations + * Reset fetched information */ void clearFetched(); /** - * Store informations about who fetch or not. This simplify sync (sync when a device without the + * Store information about who fetch or not. This simplify sync (sync when a device without the * last fetch is detected) * @param deviceId * @param commitId diff --git a/src/jamidht/conversation_module.cpp b/src/jamidht/conversation_module.cpp index 6837921edf032fad0d0b7b4207ac523ff8e5131f..cd7b4175a22811c601754d3fd308389cc4561de6 100644 --- a/src/jamidht/conversation_module.cpp +++ b/src/jamidht/conversation_module.cpp @@ -391,7 +391,7 @@ public: mutable std::mutex conversationsMtx_ {}; std::map<std::string, std::shared_ptr<SyncedConversation>, std::less<>> conversations_; - // The following informations are stored on the disk + // The following information are stored on the disk mutable std::mutex convInfosMtx_; // Note, should be locked after conversationsMtx_ if needed std::map<std::string, ConvInfo> convInfos_; @@ -585,7 +585,7 @@ ConversationModule::Impl::fetchNewCommits(const std::string& peer, auto conv = getConversation(conversationId); if (!conv) { - JAMI_WARNING("[Account {}] Could not find conversation {}, ask for an invite", + JAMI_WARNING("[Account {}] Unable to find conversation {}, ask for an invite", accountId_, conversationId); sendMsgCb_(peer, @@ -666,7 +666,7 @@ ConversationModule::Impl::fetchNewCommits(const std::string& peer, if (!shared) return; if (!ok) { - JAMI_WARNING("[Account {}] Could not fetch new commit from " + JAMI_WARNING("[Account {}] Unable to fetch new commit from " "{} for {}, other " "peer may be disconnected", shared->accountId_, @@ -708,7 +708,7 @@ ConversationModule::Impl::fetchNewCommits(const std::string& peer, return; } lk.unlock(); - JAMI_WARNING("[Account {}] Could not find conversation {}, ask for an invite", + JAMI_WARNING("[Account {}] Unable to find conversation {}, ask for an invite", accountId_, conversationId); sendMsgCb_(peer, @@ -763,7 +763,7 @@ ConversationModule::Impl::handlePendingConversation(const std::string& conversat }); conversation->onNeedSocket(onNeedSwarmSocket_); if (!conversation->isMember(username_, true)) { - JAMI_ERR("Conversation cloned but doesn't seems to be a valid member"); + JAMI_ERR("Conversation cloned but does not seems to be a valid member"); conversation->erase(); lk.lock(); erasePending(); @@ -1232,7 +1232,7 @@ ConversationModule::Impl::editMessage(const std::string& conversationId, } } if (!validCommit) { - JAMI_ERROR("Cannot edit commit {:s}", editedId); + JAMI_ERROR("Unable to edit commit {:s}", editedId); return; } // Commit message edition @@ -1667,7 +1667,7 @@ ConversationModule::loadConversations() ctx->toRm.insert(repository); } } - // Even if we found the conversation in convInfos_, we cannot assume that the list of members + // Even if we found the conversation in convInfos_, unable to assume that the list of members // stored in `convInfo` is correct (https://git.jami.net/savoirfairelinux/jami-daemon/-/issues/1025). // For this reason, we always use the list we got from the conversation repository to set // the value of `sconv->info.members`. @@ -2444,9 +2444,9 @@ ConversationModule::onSyncData(const SyncMsg& msg, if (deviceId != "") { pimpl_->cloneConversation(deviceId, peerId, conv); } else { - // In this case, informations are from JAMS - // JAMS doesn't store the conversation itself, so we - // must use informations to clone the conversation + // In this case, information is from JAMS + // JAMS does not store the conversation itself, so we + // must use information to clone the conversation addConvInfo(convInfo); toClone.emplace_back(convId); } @@ -2601,7 +2601,7 @@ ConversationModule::addConversationMember(const std::string& conversationId, { auto conv = pimpl_->getConversation(conversationId); if (not conv || not conv->conversation) { - JAMI_ERROR("Conversation {:s} doesn't exist", conversationId); + JAMI_ERROR("Conversation {:s} does not exist", conversationId); return; } std::unique_lock lk(conv->mtx); @@ -2704,7 +2704,7 @@ ConversationModule::updateConversationInfos(const std::string& conversationId, { auto conv = pimpl_->getConversation(conversationId); if (not conv or not conv->conversation) { - JAMI_ERROR("Conversation {:s} doesn't exist", conversationId); + JAMI_ERROR("Conversation {:s} does not exist", conversationId); return; } std::lock_guard lk(conv->mtx); @@ -2713,7 +2713,7 @@ ConversationModule::updateConversationInfos(const std::string& conversationId, if (ok && sync) { pimpl_->sendMessageNotification(conversationId, true, commitId); } else if (sync) - JAMI_WARNING("Couldn't update infos on {:s}", conversationId); + JAMI_WARNING("Unable to update info on {:s}", conversationId); }); } @@ -2745,7 +2745,7 @@ ConversationModule::conversationInfos(const std::string& conversationId) const else return md; } - JAMI_ERROR("Conversation {:s} doesn't exist", conversationId); + JAMI_ERROR("Conversation {:s} does not exist", conversationId); return {}; } @@ -2756,7 +2756,7 @@ ConversationModule::setConversationPreferences(const std::string& conversationId if (auto conv = pimpl_->getConversation(conversationId)) { std::unique_lock lk(conv->mtx); if (not conv->conversation) { - JAMI_ERROR("Conversation {:s} doesn't exist", conversationId); + JAMI_ERROR("Conversation {:s} does not exist", conversationId); return; } auto conversation = conv->conversation; @@ -2800,7 +2800,7 @@ ConversationModule::conversationVCard(const std::string& conversationId) const if (conv->conversation) return conv->conversation->vCard(); } - JAMI_ERROR("Conversation {:s} doesn't exist", conversationId); + JAMI_ERROR("Conversation {:s} does not exist", conversationId); return {}; } @@ -3266,7 +3266,7 @@ ConversationModule::addGitSocket(std::string_view deviceId, std::lock_guard lk(conv->mtx); conv->conversation->addGitSocket(DeviceId(deviceId), channel); } else - JAMI_WARNING("addGitSocket: can't find conversation {:s}", convId); + JAMI_WARNING("addGitSocket: Unable to find conversation {:s}", convId); } void diff --git a/src/jamidht/conversation_module.h b/src/jamidht/conversation_module.h index 546590b8058d2eec19f4a882a46ce25fdc3e9f28..b9f4cd81ff65051082e902262e0fa25cac83aef5 100644 --- a/src/jamidht/conversation_module.h +++ b/src/jamidht/conversation_module.h @@ -84,7 +84,7 @@ public: void setAccountManager(std::shared_ptr<AccountManager> accountManager); /** - * Refresh informations about conversations + * Refresh information about conversations */ void loadConversations(); diff --git a/src/jamidht/conversationrepository.cpp b/src/jamidht/conversationrepository.cpp index e6390be8606a1e197848ffca5a9e22c7960a65cd..3936a1056d6d4482237b63f017813556b823faf8 100644 --- a/src/jamidht/conversationrepository.cpp +++ b/src/jamidht/conversationrepository.cpp @@ -115,7 +115,7 @@ public: git_repository* repo = nullptr; auto err = git_repository_open(&repo, path.c_str()); if (err < 0) { - JAMI_ERROR("Couldn't open git repository: {} ({})", path, git_error_last()->message); + JAMI_ERROR("Unable to open git repository: {} ({})", path, git_error_last()->message); return {nullptr, git_repository_free}; } return {std::move(repo), git_repository_free}; @@ -343,7 +343,7 @@ public: try { cert = std::make_shared<dht::crypto::Certificate>(fileutils::loadFile(deviceFile)); } catch (const std::exception&) { - JAMI_WARNING("Could not load certificate from {}", deviceFile); + JAMI_WARNING("Unable to load certificate from {}", deviceFile); } if (!cert) return {}; @@ -457,7 +457,7 @@ create_empty_repository(const std::string& path) opts.flags |= GIT_REPOSITORY_INIT_MKPATH; opts.initial_head = "main"; if (git_repository_init_ext(&repo, path.c_str(), &opts) < 0) { - JAMI_ERROR("Couldn't create a git repository in {}", path); + JAMI_ERROR("Unable to create a git repository in {}", path); } return {std::move(repo), git_repository_free}; } @@ -473,7 +473,7 @@ git_add_all(git_repository* repo) // git add -A git_index* index_ptr = nullptr; if (git_repository_index(&index_ptr, repo) < 0) { - JAMI_ERROR("Could not open repository index"); + JAMI_ERROR("Unable to open repository index"); return false; } GitIndex index {index_ptr, git_index_free}; @@ -520,7 +520,7 @@ add_initial_files(GitRepository& repo, auto adminPath = adminsPath / fmt::format("{}.crt", parentCert->getId().toString()); std::ofstream file(adminPath, std::ios::trunc | std::ios::binary); if (!file.is_open()) { - JAMI_ERROR("Could not write data to {}", adminPath); + JAMI_ERROR("Unable to write data to {}", adminPath); return false; } file << parentCert->toString(true); @@ -535,7 +535,7 @@ add_initial_files(GitRepository& repo, auto devicePath = devicesPath / fmt::format("{}.crt", deviceId); file = std::ofstream(devicePath, std::ios::trunc | std::ios::binary); if (!file.is_open()) { - JAMI_ERROR("Could not write data to {}", devicePath); + JAMI_ERROR("Unable to write data to {}", devicePath); return false; } file << deviceCert; @@ -553,7 +553,7 @@ add_initial_files(GitRepository& repo, auto crlPath = crlsPath / deviceId / (dht::toHex(crl->getNumber()) + ".crl"); std::ofstream file(crlPath, std::ios::trunc | std::ios::binary); if (!file.is_open()) { - JAMI_ERROR("Could not write data to {}", crlPath); + JAMI_ERROR("Unable to write data to {}", crlPath); return false; } file << crl->toString(); @@ -574,7 +574,7 @@ add_initial_files(GitRepository& repo, std::ofstream file(invitedMemberPath, std::ios::trunc | std::ios::binary); if (!file.is_open()) { - JAMI_ERROR("Could not write data to {}", invitedMemberPath); + JAMI_ERROR("Unable to write data to {}", invitedMemberPath); return false; } } @@ -623,7 +623,7 @@ initial_commit(GitRepository& repo, GitSignature sig {sig_ptr, git_signature_free}; if (git_repository_index(&index_ptr, repo.get()) < 0) { - JAMI_ERROR("Could not open repository index"); + JAMI_ERROR("Unable to open repository index"); return {}; } GitIndex index {index_ptr, git_index_free}; @@ -634,7 +634,7 @@ initial_commit(GitRepository& repo, } if (git_tree_lookup(&tree_ptr, repo.get(), &tree_id) < 0) { - JAMI_ERROR("Could not look up initial tree"); + JAMI_ERROR("Unable to look up initial tree"); return {}; } GitTree tree = {tree_ptr, git_tree_free}; @@ -660,7 +660,7 @@ initial_commit(GitRepository& repo, 0, nullptr) < 0) { - JAMI_ERROR("Could not create initial buffer"); + JAMI_ERROR("Unable to create initial buffer"); return {}; } @@ -675,7 +675,7 @@ initial_commit(GitRepository& repo, "signature") < 0) { git_buf_dispose(&to_sign); - JAMI_ERROR("Could not sign initial commit"); + JAMI_ERROR("Unable to sign initial commit"); return {}; } git_buf_dispose(&to_sign); @@ -730,7 +730,7 @@ ConversationRepository::Impl::createMergeCommit(git_index* index, const std::str git_reference* head_ref_ptr = nullptr; auto repo = repository(); if (!repo || git_repository_head(&head_ref_ptr, repo.get()) < 0) { - JAMI_ERROR("[conv {}] Could not get HEAD reference", id_); + JAMI_ERROR("[conv {}] Unable to get HEAD reference", id_); return {}; } GitReference head_ref {head_ref_ptr, git_reference_free}; @@ -756,7 +756,7 @@ ConversationRepository::Impl::createMergeCommit(git_index* index, const std::str GitCommit parents[2] {{nullptr, git_commit_free}, {nullptr, git_commit_free}}; git_commit* parent = nullptr; if (git_reference_peel((git_object**) &parent, head_ref.get(), GIT_OBJ_COMMIT) < 0) { - JAMI_ERROR("[conv {}] Could not peel HEAD reference", id_); + JAMI_ERROR("[conv {}] Unable to peel HEAD reference", id_); return {}; } parents[0] = {parent, git_commit_free}; @@ -766,12 +766,12 @@ ConversationRepository::Impl::createMergeCommit(git_index* index, const std::str } git_annotated_commit* annotated_ptr = nullptr; if (git_annotated_commit_lookup(&annotated_ptr, repo.get(), &commit_id) < 0) { - JAMI_ERROR("[conv {}] Couldn't lookup commit {}", id_, wanted_ref); + JAMI_ERROR("[conv {}] Unable to lookup commit {}", id_, wanted_ref); return {}; } GitAnnotatedCommit annotated {annotated_ptr, git_annotated_commit_free}; if (git_commit_lookup(&parent, repo.get(), git_annotated_commit_id(annotated.get())) < 0) { - JAMI_ERROR("[conv {}] Couldn't lookup commit {}", id_, wanted_ref); + JAMI_ERROR("[conv {}] Unable to lookup commit {}", id_, wanted_ref); return {}; } parents[1] = {parent, git_commit_free}; @@ -782,11 +782,11 @@ ConversationRepository::Impl::createMergeCommit(git_index* index, const std::str if (git_index_write_tree_to(&tree_oid, index, repo.get()) < 0) { const git_error* err = giterr_last(); if (err) - JAMI_ERROR("[conv {}] Couldn't write index: {}", id_, err->message); + JAMI_ERROR("[conv {}] Unable to write index: {}", id_, err->message); return {}; } if (git_tree_lookup(&tree_ptr, repo.get(), &tree_oid) < 0) { - JAMI_ERROR("[conv {}] Couldn't lookup tree", id_); + JAMI_ERROR("[conv {}] Unable to lookup tree", id_); return {}; } GitTree tree = {tree_ptr, git_tree_free}; @@ -813,7 +813,7 @@ ConversationRepository::Impl::createMergeCommit(git_index* index, const std::str < 0) { const git_error* err = giterr_last(); if (err) - JAMI_ERROR("[conv {}] Could not create commit buffer: {}", id_, err->message); + JAMI_ERROR("[conv {}] Unable to create commit buffer: {}", id_, err->message); return {}; } @@ -832,7 +832,7 @@ ConversationRepository::Impl::createMergeCommit(git_index* index, const std::str "signature") < 0) { git_buf_dispose(&to_sign); - JAMI_ERROR("[conv {}] Could not sign commit", id_); + JAMI_ERROR("[conv {}] Unable to sign commit", id_); return {}; } git_buf_dispose(&to_sign); @@ -846,7 +846,7 @@ ConversationRepository::Impl::createMergeCommit(git_index* index, const std::str < 0) { const git_error* err = giterr_last(); if (err) { - JAMI_ERROR("[conv {}] Could not move commit to main: {}", id_, err->message); + JAMI_ERROR("[conv {}] Unable to move commit to main: {}", id_, err->message); emitSignal<libjami::ConversationSignal::OnConversationError>(accountId_, id_, ECOMMIT, @@ -951,7 +951,7 @@ ConversationRepository::Impl::add(const std::string& path) return false; git_index* index_ptr = nullptr; if (git_repository_index(&index_ptr, repo.get()) < 0) { - JAMI_ERROR("Could not open repository index"); + JAMI_ERROR("Unable to open repository index"); return false; } GitIndex index {index_ptr, git_index_free}; @@ -1760,7 +1760,7 @@ ConversationRepository::Impl::validateDevice() std::filesystem::path devicePath = git_repository_workdir(repo.get()); devicePath /= path; if (!std::filesystem::is_regular_file(devicePath)) { - JAMI_WARNING("[conv {}] Couldn't find file {}", id_, devicePath); + JAMI_WARNING("[conv {}] Unable to find file {}", id_, devicePath); return false; } @@ -1772,7 +1772,7 @@ ConversationRepository::Impl::validateDevice() wrongDeviceFile = true; } if (wrongDeviceFile) { - JAMI_WARNING("[conv {}] Device certificate is not valid anymore. Trying to update certificate.", id_); + JAMI_WARNING("[conv {}] Device certificate is no longer valid. Attempting to update certificate.", id_); // Replace certificate with current cert auto cert = account->identity().second; if (!cert || !account->isValidAccountDevice(*cert)) { @@ -1781,13 +1781,13 @@ ConversationRepository::Impl::validateDevice() } std::ofstream file(devicePath, std::ios::trunc | std::ios::binary); if (!file.is_open()) { - JAMI_ERROR("[conv {}] Could not write data to {}", id_, devicePath); + JAMI_ERROR("[conv {}] Unable to write data to {}", id_, devicePath); return false; } file << cert->toString(false); file.close(); if (!add(path)) { - JAMI_ERROR("[conv {}] Couldn't add file {}", id_, devicePath); + JAMI_ERROR("[conv {}] Unable to add file {}", id_, devicePath); return false; } } @@ -1814,19 +1814,19 @@ ConversationRepository::Impl::validateDevice() wrongDeviceFile = true; } if (wrongDeviceFile) { - JAMI_WARNING("[conv {}] Account certificate is not valid anymore. Trying to update certificate.", id_); + JAMI_WARNING("[conv {}] Account certificate is no longer valid. Attempting to update certificate.", id_); auto cert = account->identity().second; auto newCert = cert->issuer; if (newCert && std::filesystem::is_regular_file(parentPath)) { std::ofstream file(parentPath, std::ios::trunc | std::ios::binary); if (!file.is_open()) { - JAMI_ERROR("Could not write data to {}", path); + JAMI_ERROR("Unable to write data to {}", path); return false; } file << newCert->toString(true); file.close(); if (!add(relativeParentPath.string())) { - JAMI_WARNING("Couldn't add file {}", path); + JAMI_WARNING("Unable to add file {}", path); return false; } } @@ -1844,7 +1844,7 @@ ConversationRepository::Impl::commit(const std::string& msg, bool verifyDevice) } GitSignature sig = signature(); if (!sig) { - JAMI_ERROR("[conv {}] commit failed: Can't generate signature", id_); + JAMI_ERROR("[conv {}] commit failed: Unable to generate signature", id_); return {}; } auto account = account_.lock(); @@ -1855,7 +1855,7 @@ ConversationRepository::Impl::commit(const std::string& msg, bool verifyDevice) if (!repo) return {}; if (git_repository_index(&index_ptr, repo.get()) < 0) { - JAMI_ERROR("[conv {}] commit failed: Could not open repository index", id_); + JAMI_ERROR("[conv {}] commit failed: Unable to open repository index", id_); return {}; } GitIndex index {index_ptr, git_index_free}; @@ -1868,20 +1868,20 @@ ConversationRepository::Impl::commit(const std::string& msg, bool verifyDevice) git_tree* tree_ptr = nullptr; if (git_tree_lookup(&tree_ptr, repo.get(), &tree_id) < 0) { - JAMI_ERROR("[conv {}] Could not look up initial tree", id_); + JAMI_ERROR("[conv {}] Unable to look up initial tree", id_); return {}; } GitTree tree = {tree_ptr, git_tree_free}; git_oid commit_id; if (git_reference_name_to_id(&commit_id, repo.get(), "HEAD") < 0) { - JAMI_ERROR("[conv {}] Cannot get reference for HEAD", id_); + JAMI_ERROR("[conv {}] Unable to get reference for HEAD", id_); return {}; } git_commit* head_ptr = nullptr; if (git_commit_lookup(&head_ptr, repo.get(), &commit_id) < 0) { - JAMI_ERROR("[conv {}] Could not look up HEAD commit", id_); + JAMI_ERROR("[conv {}] Unable to look up HEAD commit", id_); return {}; } GitCommit head_commit {head_ptr, git_commit_free}; @@ -1904,7 +1904,7 @@ ConversationRepository::Impl::commit(const std::string& msg, bool verifyDevice) 1, &head_ref[0]) < 0) { - JAMI_ERROR("[conv {}] Could not create commit buffer", id_); + JAMI_ERROR("[conv {}] Unable to create commit buffer", id_); return {}; } @@ -1918,7 +1918,7 @@ ConversationRepository::Impl::commit(const std::string& msg, bool verifyDevice) signed_str.c_str(), "signature") < 0) { - JAMI_ERROR("[conv {}] Could not sign commit", id_); + JAMI_ERROR("[conv {}] Unable to sign commit", id_); git_buf_dispose(&to_sign); return {}; } @@ -1930,7 +1930,7 @@ ConversationRepository::Impl::commit(const std::string& msg, bool verifyDevice) < 0) { const git_error* err = giterr_last(); if (err) { - JAMI_ERROR("[conv {}] Could not move commit to main: {}", id_, err->message); + JAMI_ERROR("[conv {}] Unable to move commit to main: {}", id_, err->message); emitSignal<libjami::ConversationSignal::OnConversationError>(accountId_, id_, ECOMMIT, @@ -1963,7 +1963,7 @@ ConversationRepository::Impl::mode() const id_, EINVALIDMODE, "No initial commit"); - throw std::logic_error("Can't retrieve first commit"); + throw std::logic_error("Unable to retrieve first commit"); } auto commitMsg = lastMsg[0].commit_msg; @@ -1976,7 +1976,7 @@ ConversationRepository::Impl::mode() const id_, EINVALIDMODE, "No initial commit"); - throw std::logic_error("Can't retrieve first commit"); + throw std::logic_error("Unable to retrieve first commit"); } if (!root.isMember("mode")) { emitSignal<libjami::ConversationSignal::OnConversationError>(accountId_, @@ -2026,7 +2026,7 @@ ConversationRepository::Impl::diff(git_repository* repo, const std::string& idOld) const { if (!repo) { - JAMI_ERROR("Cannot get reference for HEAD"); + JAMI_ERROR("Unable to get reference for HEAD"); return {nullptr, git_diff_free}; } @@ -2035,12 +2035,12 @@ ConversationRepository::Impl::diff(git_repository* repo, git_commit* commitNew = nullptr; if (idNew == "HEAD") { if (git_reference_name_to_id(&oid, repo, "HEAD") < 0) { - JAMI_ERROR("Cannot get reference for HEAD"); + JAMI_ERROR("Unable to get reference for HEAD"); return {nullptr, git_diff_free}; } if (git_commit_lookup(&commitNew, repo, &oid) < 0) { - JAMI_ERROR("Could not look up HEAD commit"); + JAMI_ERROR("Unable to look up HEAD commit"); return {nullptr, git_diff_free}; } } else { @@ -2055,7 +2055,7 @@ ConversationRepository::Impl::diff(git_repository* repo, git_tree* tNew = nullptr; if (git_commit_tree(&tNew, new_commit.get()) < 0) { - JAMI_ERROR("Could not look up initial tree"); + JAMI_ERROR("Unable to look up initial tree"); return {nullptr, git_diff_free}; } GitTree treeNew = {tNew, git_tree_free}; @@ -2063,7 +2063,7 @@ ConversationRepository::Impl::diff(git_repository* repo, git_diff* diff_ptr = nullptr; if (idOld.empty()) { if (git_diff_tree_to_tree(&diff_ptr, repo, nullptr, treeNew.get(), {}) < 0) { - JAMI_ERROR("Could not get diff to empty repository"); + JAMI_ERROR("Unable to get diff to empty repository"); return {nullptr, git_diff_free}; } return {diff_ptr, git_diff_free}; @@ -2079,14 +2079,14 @@ ConversationRepository::Impl::diff(git_repository* repo, git_tree* tOld = nullptr; if (git_commit_tree(&tOld, old_commit.get()) < 0) { - JAMI_ERROR("Could not look up initial tree"); + JAMI_ERROR("Unable to look up initial tree"); return {nullptr, git_diff_free}; } GitTree treeOld = {tOld, git_tree_free}; // Calc diff if (git_diff_tree_to_tree(&diff_ptr, repo, treeOld.get(), treeNew.get(), {}) < 0) { - JAMI_ERROR("Could not get diff between {} and {}", idOld, idNew); + JAMI_ERROR("Unable to get diff between {} and {}", idOld, idNew); return {nullptr, git_diff_free}; } return {diff_ptr, git_diff_free}; @@ -2100,19 +2100,19 @@ ConversationRepository::Impl::behind(const std::string& from) const if (!repo) return {}; if (git_reference_name_to_id(&oid_local, repo.get(), "HEAD") < 0) { - JAMI_ERROR("Cannot get reference for HEAD"); + JAMI_ERROR("Unable to get reference for HEAD"); return {}; } oid_head = oid_local; std::string head = git_oid_tostr_s(&oid_head); if (git_oid_fromstr(&oid_remote, from.c_str()) < 0) { - JAMI_ERROR("Cannot get reference for commit {}", from); + JAMI_ERROR("Unable to get reference for commit {}", from); return {}; } git_oidarray bases; if (git_merge_bases(&bases, repo.get(), &oid_local, &oid_remote) != 0) { - JAMI_ERROR("Cannot get any merge base for commit {} and {}", from, head); + JAMI_ERROR("Unable to get any merge base for commit {} and {}", from, head); return {}; } for (std::size_t i = 0; i < bases.count; ++i) { @@ -2141,7 +2141,7 @@ ConversationRepository::Impl::forEachCommit(PreConditionCb&& preCondition, // Note: Start from head to get all merge possibilities and correct linearized parent. auto repo = repository(); if (!repo or git_reference_name_to_id(&oid, repo.get(), "HEAD") < 0) { - JAMI_ERROR("[conv {}] Cannot get reference for HEAD", id_); + JAMI_ERROR("[conv {}] Unable to get reference for HEAD", id_); return; } @@ -2160,7 +2160,7 @@ ConversationRepository::Impl::forEachCommit(PreConditionCb&& preCondition, // This fail can be ok in the case we check if a commit exists before pulling (so can fail // there). only log if the fail is unwanted. if (logIfNotFound) - JAMI_DEBUG("[conv {}] Couldn't init revwalker", id_); + JAMI_DEBUG("[conv {}] Unable to init revwalker", id_); return; } @@ -2206,7 +2206,7 @@ ConversationRepository::Impl::forEachCommit(PreConditionCb&& preCondition, git_buf signature = {}, signed_data = {}; if (git_commit_extract_signature(&signature, &signed_data, repo.get(), &oid, "signature") < 0) { - JAMI_WARNING("[conv {}] Could not extract signature for commit {}", id_, id); + JAMI_WARNING("[conv {}] Unable to extract signature for commit {}", id_, id); } else { cc.signature = base64::decode( std::string(signature.ptr, signature.ptr + signature.size)); @@ -2312,7 +2312,7 @@ ConversationRepository::Impl::treeAtCommit(git_repository* repo, const std::stri GitCommit gc = {commit, git_commit_free}; git_tree* tree = nullptr; if (git_commit_tree(&tree, gc.get()) < 0) { - JAMI_ERROR("[conv {}] Could not look up initial tree", id_); + JAMI_ERROR("[conv {}] Unable to look up initial tree", id_); return GitTree {nullptr, git_tree_free}; } return GitTree {tree, git_tree_free}; @@ -2369,7 +2369,7 @@ ConversationRepository::Impl::resolveConflicts(git_index* index, const std::stri git_oid head_commit_id; auto repo = repository(); if (!repo || git_reference_name_to_id(&head_commit_id, repo.get(), "HEAD") < 0) { - JAMI_ERROR("[conv {}] Cannot get reference for HEAD", id_); + JAMI_ERROR("[conv {}] Unable to get reference for HEAD", id_); return false; } auto commit_str = git_oid_tostr_s(&head_commit_id); @@ -2415,7 +2415,7 @@ ConversationRepository::Impl::resolveConflicts(git_index* index, const std::stri if (git_checkout_index(repo.get(), index, &opt) < 0) { const git_error* err = giterr_last(); if (err) - JAMI_ERROR("Cannot checkout index: {}", err->message); + JAMI_ERROR("Unable to checkout index: {}", err->message); return false; } @@ -2542,7 +2542,7 @@ ConversationRepository::Impl::diffStats(const GitDiff& diff) const { git_diff_stats* stats_ptr = nullptr; if (git_diff_get_stats(&stats_ptr, diff.get()) < 0) { - JAMI_ERROR("[conv {}] Could not get diff stats", id_); + JAMI_ERROR("[conv {}] Unable to get diff stats", id_); return {}; } GitDiffStats stats = {stats_ptr, git_diff_stats_free}; @@ -2550,7 +2550,7 @@ ConversationRepository::Impl::diffStats(const GitDiff& diff) const git_diff_stats_format_t format = GIT_DIFF_STATS_FULL; git_buf statsBuf = {}; if (git_diff_stats_to_buf(&statsBuf, stats.get(), format, 80) < 0) { - JAMI_ERROR("[conv {}] Could not format diff stats", id_); + JAMI_ERROR("[conv {}] Unable to format diff stats", id_); return {}; } @@ -2566,7 +2566,7 @@ ConversationRepository::createConversation(const std::shared_ptr<JamiAccount>& a ConversationMode mode, const std::string& otherMember) { - // Create temporary directory because we can't know the first hash for now + // Create temporary directory because we are unable to know the first hash for now std::uniform_int_distribution<uint64_t> dist; auto conversationsPath = fileutils::get_data_dir() / account->getAccountID() / "conversations"; dhtnet::fileutils::check_dir(conversationsPath); @@ -2594,7 +2594,7 @@ ConversationRepository::createConversation(const std::shared_ptr<JamiAccount>& a // Commit changes auto id = initial_commit(repo, account, mode, otherMember); if (id.empty()) { - JAMI_ERROR("Couldn't create initial commit in {}", tmpPath); + JAMI_ERROR("Unable to create initial commit in {}", tmpPath); dhtnet::fileutils::removeAll(tmpPath, true); return {}; } @@ -2604,7 +2604,7 @@ ConversationRepository::createConversation(const std::shared_ptr<JamiAccount>& a std::error_code ec; std::filesystem::rename(tmpPath, newPath, ec); if (ec) { - JAMI_ERROR("Couldn't move {} in {}: {}", tmpPath, newPath, ec.message()); + JAMI_ERROR("Unable to move {} in {}: {}", tmpPath, newPath, ec.message()); dhtnet::fileutils::removeAll(tmpPath, true); return {}; } @@ -2909,7 +2909,7 @@ ConversationRepository::addMember(const std::string& uri) std::ofstream file(devicePath, std::ios::trunc | std::ios::binary); if (!file.is_open()) { - JAMI_ERROR("Could not write data to {}", devicePath); + JAMI_ERROR("Unable to write data to {}", devicePath); return {}; } std::string path = "invited/" + uri; @@ -2961,7 +2961,7 @@ ConversationRepository::amend(const std::string& id, const std::string& msg) < 0) { const git_error* err = giterr_last(); if (err) - JAMI_ERROR("Could not amend commit: {}", err->message); + JAMI_ERROR("Unable to amend commit: {}", err->message); return {}; } @@ -2971,7 +2971,7 @@ ConversationRepository::amend(const std::string& id, const std::string& msg) < 0) { const git_error* err = giterr_last(); if (err) { - JAMI_ERROR("Could not move commit to main: {}", err->message); + JAMI_ERROR("Unable to move commit to main: {}", err->message); emitSignal<libjami::ConversationSignal::OnConversationError>(pimpl_->accountId_, pimpl_->id_, ECOMMIT, @@ -3014,13 +3014,13 @@ ConversationRepository::fetch(const std::string& remoteDeviceId) auto res = git_remote_lookup(&remote_ptr, repo.get(), remoteDeviceId.c_str()); if (res != 0) { if (res != GIT_ENOTFOUND) { - JAMI_ERROR("[conv {}] Couldn't lookup for remote {}", pimpl_->id_, remoteDeviceId); + JAMI_ERROR("[conv {}] Unable to lookup for remote {}", pimpl_->id_, remoteDeviceId); return false; } std::string channelName = fmt::format("git://{}/{}", remoteDeviceId, pimpl_->id_); if (git_remote_create(&remote_ptr, repo.get(), remoteDeviceId.c_str(), channelName.c_str()) < 0) { - JAMI_ERROR("[conv {}] Could not create remote for repository", pimpl_->id_); + JAMI_ERROR("[conv {}] Unable to create remote for repository", pimpl_->id_); return false; } } @@ -3044,7 +3044,7 @@ ConversationRepository::fetch(const std::string& remoteDeviceId) if (git_remote_fetch(remote.get(), nullptr, &fetch_opts, "fetch") < 0) { const git_error* err = giterr_last(); if (err) { - JAMI_WARNING("[conv {}] Could not fetch remote repository: {:s}", + JAMI_WARNING("[conv {}] Unable to fetch remote repository: {:s}", pimpl_->id_, err->message); } @@ -3100,7 +3100,7 @@ ConversationRepository::Impl::addUserDevice() if (!std::filesystem::is_regular_file(devicePath)) { std::ofstream file(devicePath, std::ios::trunc | std::ios::binary); if (!file.is_open()) { - JAMI_ERROR("Could not write data to {}", devicePath); + JAMI_ERROR("Unable to write data to {}", devicePath); return; } auto cert = account->identity().second; @@ -3109,7 +3109,7 @@ ConversationRepository::Impl::addUserDevice() file.close(); if (!add(path)) - JAMI_WARNING("Couldn't add file {}", devicePath); + JAMI_WARNING("Unable to add file {}", devicePath); } } @@ -3126,7 +3126,7 @@ ConversationRepository::Impl::resetHard() git_object *head_commit_obj = nullptr; auto error = git_revparse_single(&head_commit_obj, repo.get(), "HEAD"); if (error < 0) { - JAMI_ERROR("Could not get HEAD commit"); + JAMI_ERROR("Unable to get HEAD commit"); return; } GitObject target {head_commit_obj, git_object_free}; @@ -3193,7 +3193,7 @@ ConversationRepository::merge(const std::string& merge_id, bool force) // First, the repository must be in a clean state auto repo = pimpl_->repository(); if (!repo) { - JAMI_ERROR("[conv {}] Can't merge without repo", pimpl_->id_); + JAMI_ERROR("[conv {}] Unable to merge without repo", pimpl_->id_); return {false, ""}; } int state = git_repository_state(repo.get()); @@ -3207,19 +3207,19 @@ ConversationRepository::merge(const std::string& merge_id, bool force) } // Checkout main (to do a `git_merge branch`) if (git_repository_set_head(repo.get(), "refs/heads/main") < 0) { - JAMI_ERROR("[conv {}] Merge operation aborted: couldn't checkout main branch", pimpl_->id_); + JAMI_ERROR("[conv {}] Merge operation aborted: unable to checkout main branch", pimpl_->id_); return {false, ""}; } // Then check that merge_id exists git_oid commit_id; if (git_oid_fromstr(&commit_id, merge_id.c_str()) < 0) { - JAMI_ERROR("[conv {}] Merge operation aborted: couldn't lookup commit {}", pimpl_->id_, merge_id); + JAMI_ERROR("[conv {}] Merge operation aborted: unable to lookup commit {}", pimpl_->id_, merge_id); return {false, ""}; } git_annotated_commit* annotated_ptr = nullptr; if (git_annotated_commit_lookup(&annotated_ptr, repo.get(), &commit_id) < 0) { - JAMI_ERROR("[conv {}] Merge operation aborted: couldn't lookup commit {}", pimpl_->id_, merge_id); + JAMI_ERROR("[conv {}] Merge operation aborted: unable to lookup commit {}", pimpl_->id_, merge_id); return {false, ""}; } GitAnnotatedCommit annotated {annotated_ptr, git_annotated_commit_free}; @@ -3263,20 +3263,20 @@ ConversationRepository::merge(const std::string& merge_id, bool force) // Else we want to check for conflicts git_oid head_commit_id; if (git_reference_name_to_id(&head_commit_id, repo.get(), "HEAD") < 0) { - JAMI_ERROR("[conv {}] Cannot get reference for HEAD", pimpl_->id_); + JAMI_ERROR("[conv {}] Unable to get reference for HEAD", pimpl_->id_); return {false, ""}; } git_commit* head_ptr = nullptr; if (git_commit_lookup(&head_ptr, repo.get(), &head_commit_id) < 0) { - JAMI_ERROR("[conv {}] Could not look up HEAD commit", pimpl_->id_); + JAMI_ERROR("[conv {}] Unable to look up HEAD commit", pimpl_->id_); return {false, ""}; } GitCommit head_commit {head_ptr, git_commit_free}; git_commit* other__ptr = nullptr; if (git_commit_lookup(&other__ptr, repo.get(), &commit_id) < 0) { - JAMI_ERROR("[conv {}] Could not look up HEAD commit", pimpl_->id_); + JAMI_ERROR("[conv {}] Unable to look up HEAD commit", pimpl_->id_); return {false, ""}; } GitCommit other_commit {other__ptr, git_commit_free}; @@ -3296,7 +3296,7 @@ ConversationRepository::merge(const std::string& merge_id, bool force) if (git_index_has_conflicts(index.get())) { JAMI_LOG("Some conflicts were detected during the merge operations. Resolution phase."); if (!pimpl_->resolveConflicts(index.get(), merge_id) or !git_add_all(repo.get())) { - JAMI_ERROR("Merge operation aborted; Can't automatically resolve conflicts"); + JAMI_ERROR("Merge operation aborted; Unable to automatically resolve conflicts"); return {false, ""}; } } @@ -3379,7 +3379,7 @@ ConversationRepository::join() } std::ofstream file(memberFile, std::ios::trunc | std::ios::binary); if (!file.is_open()) { - JAMI_ERROR("Could not write data to {}", memberFile); + JAMI_ERROR("Unable to write data to {}", memberFile); return {}; } file << parentCert->toString(true); @@ -3539,7 +3539,7 @@ ConversationRepository::voteKick(const std::string& uri, const std::string& type auto votePath = fileutils::getFullPath(voteDirectory, adminUri); std::ofstream voteFile(votePath, std::ios::trunc | std::ios::binary); if (!voteFile.is_open()) { - JAMI_ERROR("Could not write data to {}", votePath); + JAMI_ERROR("Unable to write data to {}", votePath); return {}; } voteFile.close(); @@ -3581,7 +3581,7 @@ ConversationRepository::voteUnban(const std::string& uri, const std::string_view auto votePath = voteDirectory / adminUri; std::ofstream voteFile(votePath, std::ios::trunc | std::ios::binary); if (!voteFile.is_open()) { - JAMI_ERROR("Could not write data to {}", votePath); + JAMI_ERROR("Unable to write data to {}", votePath); return {}; } voteFile.close(); @@ -3899,7 +3899,7 @@ ConversationRepository::updateInfos(const std::map<std::string, std::string>& pr auto profilePath = repoPath / "profile.vcf"; std::ofstream file(profilePath, std::ios::trunc | std::ios::binary); if (!file.is_open()) { - JAMI_ERROR("Could not write data to {}", profilePath); + JAMI_ERROR("Unable to write data to {}", profilePath); return {}; } @@ -3996,7 +3996,7 @@ ConversationRepository::getHead() const if (auto repo = pimpl_->repository()) { git_oid commit_id; if (git_reference_name_to_id(&commit_id, repo.get(), "HEAD") < 0) { - JAMI_ERROR("Cannot get reference for HEAD"); + JAMI_ERROR("Unable to get reference for HEAD"); return {}; } if (auto commit_str = git_oid_tostr_s(&commit_id)) diff --git a/src/jamidht/gitserver.cpp b/src/jamidht/gitserver.cpp index 61566e23cb9dccbb390579a18e0903a06e7fd903..941d9a335d08a58b827a413c3993528decc2802e 100644 --- a/src/jamidht/gitserver.cpp +++ b/src/jamidht/gitserver.cpp @@ -113,7 +113,7 @@ GitServer::Impl::parseOrder(std::string_view buf) unsigned int pkt_len = 0; auto [p, ec] = std::from_chars(pkt.data(), pkt.data() + 4, pkt_len, 16); if (ec != std::errc()) { - JAMI_ERROR("Can't parse packet size"); + JAMI_ERROR("Unable to parse packet size"); } if (pkt_len != pkt.size()) { // Store next packet part @@ -189,7 +189,7 @@ GitServer::Impl::parseOrder(std::string_view buf) // TODO do not open repository every time git_repository* repo; if (git_repository_open(&repo, repository_.c_str()) != 0) { - JAMI_WARN("Couldn't open %s", repository_.c_str()); + JAMI_WARN("Unable to open %s", repository_.c_str()); return !cachedPkt_.empty(); } GitRepository rep {repo, git_repository_free}; @@ -218,7 +218,7 @@ GitServer::Impl::sendReferenceCapabilities(bool sendVersion) // https://github.com/git/git/blob/master/Documentation/technical/pack-protocol.txt#L166 git_repository* repo; if (git_repository_open(&repo, repository_.c_str()) != 0) { - JAMI_WARNING("Couldn't open {}", repository_); + JAMI_WARNING("Unable to open {}", repository_); socket_->shutdown(); return; } @@ -234,7 +234,7 @@ GitServer::Impl::sendReferenceCapabilities(bool sendVersion) toSend.size(), ec); if (ec) { - JAMI_WARNING("Couldn't send data for {}: {}", repository_, ec.message()); + JAMI_WARNING("Unable to send data for {}: {}", repository_, ec.message()); socket_->shutdown(); return; } @@ -242,7 +242,7 @@ GitServer::Impl::sendReferenceCapabilities(bool sendVersion) git_oid commit_id; if (git_reference_name_to_id(&commit_id, rep.get(), "HEAD") < 0) { - JAMI_ERROR("Cannot get reference for HEAD"); + JAMI_ERROR("Unable to get reference for HEAD"); socket_->shutdown(); return; } @@ -259,7 +259,7 @@ GitServer::Impl::sendReferenceCapabilities(bool sendVersion) for (std::size_t i = 0; i < refs.count; ++i) { std::string_view ref = refs.strings[i]; if (git_reference_name_to_id(&commit_id, rep.get(), ref.data()) < 0) { - JAMI_WARNING("Cannot get reference for {}", ref); + JAMI_WARNING("Unable to get reference for {}", ref); continue; } currentHead = git_oid_tostr_s(&commit_id); @@ -275,7 +275,7 @@ GitServer::Impl::sendReferenceCapabilities(bool sendVersion) auto toSend = packet.str(); socket_->write(reinterpret_cast<const unsigned char*>(toSend.data()), toSend.size(), ec); if (ec) { - JAMI_WARNING("Couldn't send data for {}: {}", repository_, ec.message()); + JAMI_WARNING("Unable to send data for {}: {}", repository_, ec.message()); socket_->shutdown(); } } @@ -290,7 +290,7 @@ GitServer::Impl::ACKCommon() 18 + common_.size() /* size + ACK + space * 2 + continue + \n */, common_); socket_->write(reinterpret_cast<const unsigned char*>(toSend.c_str()), toSend.size(), ec); if (ec) { - JAMI_WARNING("Couldn't send data for {}: {}", repository_, ec.message()); + JAMI_WARNING("Unable to send data for {}: {}", repository_, ec.message()); socket_->shutdown(); } } @@ -306,7 +306,7 @@ GitServer::Impl::ACKFirst() 9 + common_.size() /* size + ACK + space + \n */, common_); socket_->write(reinterpret_cast<const unsigned char*>(toSend.c_str()), toSend.size(), ec); if (ec) { - JAMI_WARNING("Couldn't send data for {}: {}", repository_, ec.message()); + JAMI_WARNING("Unable to send data for {}: {}", repository_, ec.message()); socket_->shutdown(); return false; } @@ -321,7 +321,7 @@ GitServer::Impl::NAK() // NAK socket_->write(reinterpret_cast<const unsigned char*>(NAK_PKT.data()), NAK_PKT.size(), ec); if (ec) { - JAMI_WARNING("Couldn't send data for {}: {}", repository_, ec.message()); + JAMI_WARNING("Unable to send data for {}: {}", repository_, ec.message()); socket_->shutdown(); return false; } @@ -333,14 +333,14 @@ GitServer::Impl::sendPackData() { git_repository* repo_ptr; if (git_repository_open(&repo_ptr, repository_.c_str()) != 0) { - JAMI_WARN("Couldn't open %s", repository_.c_str()); + JAMI_WARN("Unable to open %s", repository_.c_str()); return; } GitRepository repo {repo_ptr, git_repository_free}; git_packbuilder* pb_ptr; if (git_packbuilder_new(&pb_ptr, repo.get()) != 0) { - JAMI_WARNING("Couldn't open packbuilder for {}", repository_); + JAMI_WARNING("Unable to open packbuilder for {}", repository_); return; } GitPackBuilder pb {pb_ptr, git_packbuilder_free}; @@ -348,7 +348,7 @@ GitServer::Impl::sendPackData() std::string fetched = wantedReference_; git_oid oid; if (git_oid_fromstr(&oid, fetched.c_str()) < 0) { - JAMI_ERROR("Cannot get reference for commit {}", fetched); + JAMI_ERROR("Unable to get reference for commit {}", fetched); return; } @@ -374,7 +374,7 @@ GitServer::Impl::sendPackData() if (haveCommit && parents.size() == 0 /* We are sure that all commits are there */) break; if (git_packbuilder_insert_commit(pb.get(), &oid) != 0) { - JAMI_WARN("Couldn't open insert commit %s for %s", + JAMI_WARN("Unable to open insert commit %s for %s", git_oid_tostr_s(&oid), repository_.c_str()); return; @@ -383,7 +383,7 @@ GitServer::Impl::sendPackData() // Get next commit to pack git_commit* commit_ptr; if (git_commit_lookup(&commit_ptr, repo.get(), &oid) < 0) { - JAMI_ERR("Could not look up current commit"); + JAMI_ERR("Unable to look up current commit"); return; } GitCommit commit {commit_ptr, git_commit_free}; @@ -398,7 +398,7 @@ GitServer::Impl::sendPackData() git_buf data = {}; if (git_packbuilder_write_buf(&data, pb.get()) != 0) { - JAMI_WARN("Couldn't write pack data for %s", repository_.c_str()); + JAMI_WARN("Unable to write pack data for %s", repository_.c_str()); return; } @@ -422,7 +422,7 @@ GitServer::Impl::sendPackData() toSendData.size(), ec); if (ec) { - JAMI_WARNING("Couldn't send data for {}: {}", repository_, ec.message()); + JAMI_WARNING("Unable to send data for {}: {}", repository_, ec.message()); git_buf_dispose(&data); return; } @@ -434,7 +434,7 @@ GitServer::Impl::sendPackData() // And finish by a little FLUSH socket_->write(reinterpret_cast<const uint8_t*>(FLUSH_PKT.data()), FLUSH_PKT.size(), ec); if (ec) { - JAMI_WARNING("Couldn't send data for {}: {}", repository_, ec.message()); + JAMI_WARNING("Unable to send data for {}: {}", repository_, ec.message()); } // Clear sent data diff --git a/src/jamidht/jamiaccount.cpp b/src/jamidht/jamiaccount.cpp index e17e17edaf79941ec3efdbcda5d5e9933b09ef41..16659298ca66057ff29ff97ecc437772617dec14 100644 --- a/src/jamidht/jamiaccount.cpp +++ b/src/jamidht/jamiaccount.cpp @@ -333,7 +333,7 @@ JamiAccount::newIncomingCall(const std::string& from, return call; } - JAMI_ERR("newIncomingCall: can't find matching call for %s", from.c_str()); + JAMI_ERR("newIncomingCall: unable to find matching call for %s", from.c_str()); return nullptr; } @@ -775,7 +775,7 @@ JamiAccount::onConnectedOutgoingCall(const std::shared_ptr<SIPCall>& call, // The session should be ready to receive media once the first INVITE is sent, before // the session initialization is completed if (!getSystemCodecContainer()->searchCodecByName("PCMA", jami::MEDIA_AUDIO)) - JAMI_WARN("Could not instantiate codec for early media"); + JAMI_WARN("Unable to instantiate codec for early media"); // Building the local SDP offer auto& sdp = call->getSDP(); @@ -790,7 +790,7 @@ JamiAccount::onConnectedOutgoingCall(const std::shared_ptr<SIPCall>& call, } if (not sdp.createOffer(mediaAttrList)) { - JAMI_ERR("Could not send outgoing INVITE request for new call"); + JAMI_ERR("Unable to send outgoing INVITE request for new call"); return; } @@ -806,7 +806,7 @@ JamiAccount::onConnectedOutgoingCall(const std::shared_ptr<SIPCall>& call, return; if (not account->SIPStartCall(*call, target)) { - JAMI_ERR("Could not send outgoing INVITE request for new call"); + JAMI_ERR("Unable to send outgoing INVITE request for new call"); } }); } @@ -852,14 +852,14 @@ JamiAccount::SIPStartCall(SIPCall& call, const dhtnet::IpAddr& target) pjsip_tx_data* tdata; if (pjsip_inv_invite(call.inviteSession_.get(), &tdata) != PJ_SUCCESS) { - JAMI_ERR("Could not initialize invite messager for this call"); + JAMI_ERR("Unable to initialize invite messager for this call"); return false; } pjsip_tpselector tp_sel; tp_sel.type = PJSIP_TPSELECTOR_TRANSPORT; if (!call.getTransport()) { - JAMI_ERR("Could not get transport for this call"); + JAMI_ERR("Unable to get transport for this call"); return false; } tp_sel.u.transport = call.getTransport()->get(); @@ -928,7 +928,7 @@ JamiAccount::loadConfig() proxyServerCached_ = root[getProxyConfigKey()].asString(); } } catch (const std::exception& e) { - JAMI_LOG("[Account {}] Can't load proxy URL from cache: {}", getAccountID(), e.what()); + JAMI_LOG("[Account {}] Unable to load proxy URL from cache: {}", getAccountID(), e.what()); proxyServerCached_.clear(); } } else { @@ -948,14 +948,14 @@ JamiAccount::changeArchivePassword(const std::string& password_old, const std::s { try { if (!accountManager_->changePassword(password_old, password_new)) { - JAMI_ERR("[Account %s] Can't change archive password", getAccountID().c_str()); + JAMI_ERR("[Account %s] Unable to change archive password", getAccountID().c_str()); return false; } editConfig([&](JamiAccountConfig& config) { config.archiveHasPassword = not password_new.empty(); }); } catch (const std::exception& ex) { - JAMI_ERR("[Account %s] Can't change archive password: %s", + JAMI_ERR("[Account %s] Unable to change archive password: %s", getAccountID().c_str(), ex.what()); if (password_old.empty()) { @@ -1630,7 +1630,7 @@ JamiAccount::doRegister() JAMI_LOG("[Account {:s}] Starting account..", getAccountID()); // invalid state transitions: - // INITIALIZING: generating/loading certificates, can't register + // INITIALIZING: generating/loading certificates, unable to register // NEED_MIGRATION: old account detected, user needs to migrate if (registrationState_ == RegistrationState::INITIALIZING || registrationState_ == RegistrationState::ERROR_NEED_MIGRATION) @@ -2655,7 +2655,7 @@ JamiAccount::getDhtProxyServer(const std::string& serverList) if (file.is_open()) file << node; else - JAMI_WARNING("Cannot write into {}", proxyCachePath); + JAMI_WARNING("Unable to write into {}", proxyCachePath); } return proxyServerCached_; } @@ -2918,7 +2918,7 @@ JamiAccount::sendTrustRequest(const std::string& to, const std::vector<uint8_t>& auto cachedFile = requestPath / to; std::ofstream req(cachedFile, std::ios::trunc | std::ios::binary); if (!req.is_open()) { - JAMI_ERROR("Could not write data to {}", cachedFile); + JAMI_ERROR("Unable to write data to {}", cachedFile); return; } @@ -3075,7 +3075,7 @@ JamiAccount::sendMessage(const std::string& to, if (onlyConnected) return; - // We couldn't send the message directly, try connecting + // We are unable to send the message directly, try connecting messageEngine_.onMessageSent(to, token, false, deviceId); // Get conversation id, which will be used by the iOS notification extension @@ -3092,7 +3092,7 @@ JamiAccount::sendMessage(const std::string& to, return value.asString(); } } else { - JAMI_WARNING("Could not parse jsonData to get conversation id"); + JAMI_WARNING("Unable to parse jsonData to get conversation id"); } return ""; }; @@ -3337,7 +3337,7 @@ JamiAccount::handleMessage(const std::string& from, const std::pair<std::string, Json::CharReaderBuilder rbuilder; auto reader = std::unique_ptr<Json::CharReader>(rbuilder.newCharReader()); if (!reader->parse(m.second.data(), m.second.data() + m.second.size(), &json, &err)) { - JAMI_ERROR("Can't parse server response: {}", err); + JAMI_ERROR("Unable to parse server response: {}", err); return false; } @@ -3361,7 +3361,7 @@ JamiAccount::handleMessage(const std::string& from, const std::pair<std::string, Json::CharReaderBuilder rbuilder; auto reader = std::unique_ptr<Json::CharReader>(rbuilder.newCharReader()); if (!reader->parse(m.second.data(), m.second.data() + m.second.size(), &json, &err)) { - JAMI_ERROR("Can't parse server response: {}", err); + JAMI_ERROR("Unable to parse server response: {}", err); return false; } convModule()->onConversationRequest(from, json); @@ -3405,7 +3405,7 @@ JamiAccount::handleMessage(const std::string& from, const std::pair<std::string, if (matched_pattern.ready() && !matched_pattern.empty() && matched_pattern[1].matched) { messageId = matched_pattern[1]; } else { - JAMI_WARNING("Message displayed: can't parse message ID"); + JAMI_WARNING("Message displayed: unable to parse message ID"); return false; } @@ -3415,7 +3415,7 @@ JamiAccount::handleMessage(const std::string& from, const std::pair<std::string, if (matched_pattern.ready() && !matched_pattern.empty() && matched_pattern[1].matched) { isDisplayed = matched_pattern[1] == "displayed"; } else { - JAMI_WARNING("Message displayed: can't parse status"); + JAMI_WARNING("Message displayed: unable to parse status"); return false; } @@ -3456,7 +3456,7 @@ JamiAccount::handleMessage(const std::string& from, const std::pair<std::string, customStatus); return true; } else { - JAMI_WARNING("Presence: can't parse status"); + JAMI_WARNING("Presence: unable to parse status"); } } @@ -3976,11 +3976,11 @@ JamiAccount::sendFile(const std::string& conversationId, if (path != filelinkPath && !std::filesystem::is_symlink(filelinkPath)) { if (!fileutils::createFileLink(filelinkPath, path, true)) { JAMI_WARNING( - "Cannot create symlink for file transfer {} - {}. Copy file", + "Unable to create symlink for file transfer {} - {}. Copy file", filelinkPath, path); if (!std::filesystem::copy_file(path, filelinkPath)) { - JAMI_ERROR("Cannot copy file for file transfer {} - {}", + JAMI_ERROR("Unable to copy file for file transfer {} - {}", filelinkPath, path); } diff --git a/src/jamidht/jamiaccount.h b/src/jamidht/jamiaccount.h index 0edfe3582177c41043bb7137fa5e11306aa1faa6..aeec490e3dccb1659e7b4b2adc897fae7609208b 100644 --- a/src/jamidht/jamiaccount.h +++ b/src/jamidht/jamiaccount.h @@ -552,7 +552,7 @@ public: void reloadContacts(); /** - * Make sure appdata/contacts.yml contains correct informations + * Make sure appdata/contacts.yml contains correct information * @param removedConv The current removed conversations */ void unlinkConversations(const std::set<std::string>& removedConv); @@ -780,7 +780,7 @@ private: { std::shared_ptr<SipTransport> transport; // Needs to keep track of that channel to access underlying ICE - // informations, as the SipTransport use a generic transport + // information, as the SipTransport use a generic transport std::shared_ptr<dhtnet::ChannelSocket> channel; }; // NOTE: here we use a vector to avoid race conditions. In fact the contact diff --git a/src/jamidht/jamiaccount_config.cpp b/src/jamidht/jamiaccount_config.cpp index aa841b267c0479e384112533702cc4030f92147f..4cee4c59d58eee6f7f1d4a4f5683e6d6ddcf5230 100644 --- a/src/jamidht/jamiaccount_config.cpp +++ b/src/jamidht/jamiaccount_config.cpp @@ -116,7 +116,7 @@ JamiAccountConfig::unserialize(const YAML::Node& node) auto receipt_sig = node[Conf::RING_ACCOUNT_RECEIPT_SIG].as<YAML::Binary>(); receiptSignature = {receipt_sig.data(), receipt_sig.data() + receipt_sig.size()}; } catch (const std::exception& e) { - JAMI_WARN("can't read receipt: %s", e.what()); + JAMI_WARN("Unable to read receipt: %s", e.what()); } parseValueOptional(node, libjami::Account::ConfProperties::DHT_PEER_DISCOVERY, dhtPeerDiscovery); diff --git a/src/jamidht/namedirectory.cpp b/src/jamidht/namedirectory.cpp index 1c35a8980dc882716c0383e43292095426aa693a..20d5438f078c9dd9def6eee1d9d0f39aaadcdab5 100644 --- a/src/jamidht/namedirectory.cpp +++ b/src/jamidht/namedirectory.cpp @@ -92,7 +92,7 @@ NameDirectory::lookupUri(std::string_view uri, const std::string& default_server return; } } - JAMI_ERR("Can't parse URI: %.*s", (int) uri.size(), uri.data()); + JAMI_ERR("Unable to parse URI: %.*s", (int) uri.size(), uri.data()); cb("", Response::invalidResponse); } @@ -188,7 +188,7 @@ NameDirectory::lookupAddress(const std::string& addr, LookupCallback cb) response.body.data() + response.body.size(), &json, &err)) { - JAMI_DBG("Address lookup for %s: can't parse server response: %s", + JAMI_DBG("Address lookup for %s: Unable to parse server response: %s", addr.c_str(), response.body.c_str()); cb("", Response::error); @@ -274,7 +274,7 @@ NameDirectory::lookupName(const std::string& n, LookupCallback cb) response.body.data() + response.body.size(), &json, &err)) { - JAMI_ERR("Name lookup for %s: can't parse server response: %s", + JAMI_ERR("Name lookup for %s: Unable to parse server response: %s", name.c_str(), response.body.c_str()); cb("", Response::error); @@ -490,7 +490,7 @@ NameDirectory::loadCache() std::lock_guard lock(dhtnet::fileutils::getFileLock(cachePath_)); std::ifstream file(cachePath_); if (!file.is_open()) { - JAMI_DBG("Could not load %s", cachePath_.c_str()); + JAMI_DBG("Unable to load %s", cachePath_.c_str()); return; } std::string line; diff --git a/src/jamidht/server_account_manager.cpp b/src/jamidht/server_account_manager.cpp index d69e115fd81fa71c4a06c262f812a8733b91f1d8..6ddb87406f5fec2896ed7d00379949eb360d4f2b 100644 --- a/src/jamidht/server_account_manager.cpp +++ b/src/jamidht/server_account_manager.cpp @@ -85,7 +85,7 @@ ServerAccountManager::initAuthentication(const std::string& accountId, onChange_ = std::move(onChange); const std::string url = managerHostname_ + PATH_DEVICE; - JAMI_WARN("[Auth] authentication with: %s to %s", + JAMI_WARN("[Auth] Authentication with: %s to %s", ctx->credentials->username.c_str(), url.c_str()); @@ -107,7 +107,7 @@ ServerAccountManager::initAuthentication(const std::string& accountId, response.status_code, response.body); auto this_ = std::static_pointer_cast<ServerAccountManager>(w.lock()); if (response.status_code == 0 || this_ == nullptr) - ctx->onFailure(AuthError::SERVER_ERROR, "Can't connect to server"); + ctx->onFailure(AuthError::SERVER_ERROR, "Unable to connect to server"); else if (response.status_code >= 400 && response.status_code < 500) ctx->onFailure(AuthError::INVALID_ARGUMENTS, "Invalid credentials provided!"); else if (response.status_code < 200 || response.status_code > 299) @@ -120,7 +120,7 @@ ServerAccountManager::initAuthentication(const std::string& accountId, json["certificateChain"].asString()); auto accountCert = cert->issuer; if (not accountCert) { - JAMI_ERR("[Auth] Can't parse certificate: no issuer"); + JAMI_ERR("[Auth] Unable to parse certificate: no issuer"); ctx->onFailure(AuthError::SERVER_ERROR, "Invalid certificate from server"); break; @@ -134,10 +134,10 @@ ServerAccountManager::initAuthentication(const std::string& accountId, receipt.data() + receipt.size(), &receiptJson, &err)) { - JAMI_ERR("[Auth] Can't parse receipt from server: %s", + JAMI_ERR("[Auth] Unable to parse receipt from server: %s", err.c_str()); ctx->onFailure(AuthError::SERVER_ERROR, - "Can't parse receipt from server"); + "Unable to parse receipt from server"); break; } auto receiptSignature = base64::decode( @@ -166,7 +166,7 @@ ServerAccountManager::initAuthentication(const std::string& accountId, info->devicePk->getId().toString()); if (not info->announce) { ctx->onFailure(AuthError::SERVER_ERROR, - "Can't parse announce from server"); + "Unable to parse announce from server"); return; } info->username = ctx->credentials->username; @@ -239,7 +239,7 @@ ServerAccountManager::authenticateDevice() authFailed(TokenScope::Device, 0); } const std::string url = managerHostname_ + JAMI_PATH_LOGIN; - JAMI_WARN("[Auth] getting a device token: %s", url.c_str()); + JAMI_WARN("[Auth] Getting a device token: %s", url.c_str()); auto request = std::make_shared<Request>( *Manager::instance().ioContext(), url, @@ -258,7 +258,7 @@ void ServerAccountManager::authenticateAccount(const std::string& username, const std::string& password) { const std::string url = managerHostname_ + JAMI_PATH_LOGIN; - JAMI_WARN("[Auth] getting a device token: %s", url.c_str()); + JAMI_WARN("[Auth] Getting a device token: %s", url.c_str()); auto request = std::make_shared<Request>( *Manager::instance().ioContext(), url, @@ -395,7 +395,7 @@ ServerAccountManager::syncDevices() const std::string urlConversations = managerHostname_ + PATH_CONVERSATIONS; const std::string urlConversationsRequests = managerHostname_ + PATH_CONVERSATIONS_REQUESTS; - JAMI_WARNING("[Auth] sync conversations {}", urlConversations); + JAMI_WARNING("[Auth] Sync conversations {}", urlConversations); Json::Value jsonConversations(Json::arrayValue); for (const auto& [key, convInfo] : ConversationModule::convInfos(accountId_)) { jsonConversations.append(convInfo.toJson()); @@ -413,7 +413,7 @@ ServerAccountManager::syncDevices() try { JAMI_WARNING("[Auth] Got server response: {}", response.body); if (not json.isArray()) { - JAMI_ERROR("[Auth] Can't parse server response: not an array"); + JAMI_ERROR("[Auth] Unable to parse server response: not an array"); } else { SyncMsg convs; for (unsigned i = 0, n = json.size(); i < n; i++) { @@ -437,7 +437,7 @@ ServerAccountManager::syncDevices() }, logger_)); - JAMI_WARNING("[Auth] sync conversations requests {}", urlConversationsRequests); + JAMI_WARNING("[Auth] Sync conversations requests {}", urlConversationsRequests); Json::Value jsonConversationsRequests(Json::arrayValue); for (const auto& [key, convRequest] : ConversationModule::convRequests(accountId_)) { auto jsonConversation = convRequest.toJson(); @@ -456,7 +456,7 @@ ServerAccountManager::syncDevices() try { JAMI_WARNING("[Auth] Got server response: {}", response.body); if (not json.isArray()) { - JAMI_ERROR("[Auth] Can't parse server response: not an array"); + JAMI_ERROR("[Auth] Unable to parse server response: not an array"); } else { SyncMsg convReqs; for (unsigned i = 0, n = json.size(); i < n; i++) { @@ -500,7 +500,7 @@ ServerAccountManager::syncDevices() try { JAMI_WARNING("[Auth] Got server response: {}", response.body); if (not json.isArray()) { - JAMI_ERROR("[Auth] Can't parse server response: not an array"); + JAMI_ERROR("[Auth] Unable to parse server response: not an array"); } else { for (unsigned i = 0, n = json.size(); i < n; i++) { const auto& e = json[i]; @@ -532,7 +532,7 @@ ServerAccountManager::syncDevices() try { JAMI_WARNING("[Auth] Got server response: {}", response.body); if (not json.isArray()) { - JAMI_ERROR("[Auth] Can't parse server response: not an array"); + JAMI_ERROR("[Auth] Unable to parse server response: not an array"); } else { for (unsigned i = 0, n = json.size(); i < n; i++) { const auto& e = json[i]; @@ -560,7 +560,7 @@ ServerAccountManager::syncBlueprintConfig(SyncBlueprintCallback onSuccess) { auto syncBlueprintCallback = std::make_shared<SyncBlueprintCallback>(onSuccess); const std::string urlBlueprints = managerHostname_ + PATH_BLUEPRINT; - JAMI_DEBUG("[Auth] synchronize blueprint configuration {}", urlBlueprints); + JAMI_DEBUG("[Auth] Synchronize blueprint configuration {}", urlBlueprints); sendDeviceRequest(std::make_shared<Request>( *Manager::instance().ioContext(), urlBlueprints, diff --git a/src/jamidht/swarm/routing_table.cpp b/src/jamidht/swarm/routing_table.cpp index 500f5c7a7a6d476d3c20a6ff261075eff764069b..7125b89423a00a6b7eecedd7fa833634e4edc945 100644 --- a/src/jamidht/swarm/routing_table.cpp +++ b/src/jamidht/swarm/routing_table.cpp @@ -162,7 +162,7 @@ Bucket::getNodeTimer(const std::shared_ptr<dhtnet::ChannelSocketInterface>& sock { auto node = nodes.find(socket->deviceId()); if (node == nodes.end()) { - throw std::range_error("Can't find timer " + socket->deviceId().toString()); + throw std::range_error("Unable to find timer " + socket->deviceId().toString()); } return node->second.refresh_timer; } diff --git a/src/jamidht/sync_channel_handler.h b/src/jamidht/sync_channel_handler.h index f511f087e1981e74f01f5a1cedad1dfaabcd8ed8..106d6fde8362aa0890bb1107243015e9c5f6df20 100644 --- a/src/jamidht/sync_channel_handler.h +++ b/src/jamidht/sync_channel_handler.h @@ -27,7 +27,7 @@ namespace jami { /** - * Manages channels for syncing informations + * Manages channels for syncing information */ class SyncChannelHandler : public ChannelHandlerInterface { diff --git a/src/jamidht/sync_module.cpp b/src/jamidht/sync_module.cpp index 43a44d7e4a0a97229b3ba9cef6a1099b27d53c7e..17512439170b9b1d3340c828e70ecc8b358c6760 100644 --- a/src/jamidht/sync_module.cpp +++ b/src/jamidht/sync_module.cpp @@ -63,7 +63,7 @@ SyncModule::Impl::syncInfos(const std::shared_ptr<dhtnet::ChannelSocket>& socket if (!syncMsg) { // Send contacts infos // This message can be big. TODO rewrite to only take UINT16_MAX bytes max or split it multiple - // messages. For now, write 3 messages (UINT16_MAX*3 should be enough for all informations). + // messages. For now, write 3 messages (UINT16_MAX*3 should be enough for all information). if (auto info = acc->accountManager()->getInfo()) { if (info->contacts) { SyncMsg msg; diff --git a/src/jamidht/sync_module.h b/src/jamidht/sync_module.h index 3cbf23164096d3c4fde63b1787e77d9aa24b8837..9da399dcf1952e813e973a9f9d688b50929e0c18 100644 --- a/src/jamidht/sync_module.h +++ b/src/jamidht/sync_module.h @@ -41,7 +41,7 @@ public: const DeviceId& deviceId); /** - * Send sync informations to connected device + * Send sync information to connected device * @param deviceId Connected device * @param socket Related socket * @param syncMsg Default message diff --git a/src/jamidht/transfer_channel_handler.cpp b/src/jamidht/transfer_channel_handler.cpp index 8eacf2882b569f3521889ff420a5ad8bbdcec2c6..0a413575fc8cccd5a59b6cc104bd88cbd02127bd 100644 --- a/src/jamidht/transfer_channel_handler.cpp +++ b/src/jamidht/transfer_channel_handler.cpp @@ -124,7 +124,7 @@ TransferChannelHandler::onReady(const std::shared_ptr<dht::crypto::Certificate>& try { lastModified = jami::to_int<uint64_t>(keyVal[1]); } catch (const std::exception& e) { - JAMI_WARNING("TransferChannel: can't parse modified date: {}: {}", + JAMI_WARNING("TransferChannel: Unable to parse modified date: {}: {}", keyVal[1], e.what()); } } diff --git a/src/manager.cpp b/src/manager.cpp index 32f927903c4371747b664243ba05727216d2d000..fcd22681463444be714194c155d676d7413451ea 100644 --- a/src/manager.cpp +++ b/src/manager.cpp @@ -484,7 +484,7 @@ Manager::ManagerPimpl::parseConfiguration() result = false; } } catch (const YAML::BadFile& e) { - JAMI_WARN("Could not open configuration file"); + JAMI_WARN("Unable to open configuration file"); result = false; } @@ -598,7 +598,7 @@ Manager::ManagerPimpl::processRemainingParticipants(Conference& conf) std::filesystem::path Manager::ManagerPimpl::retrieveConfigPath() const { - // TODO: Migrate config file name from dring.yml to jami.yml. + // TODO: Migrate config filename from dring.yml to jami.yml. return fileutils::get_config_dir() / "dring.yml"; } @@ -1191,7 +1191,7 @@ Manager::hangupCall(const std::string& accountId, const std::string& callId) /* We often get here when the call was hungup before being created */ auto call = account->getCall(callId); if (not call) { - JAMI_WARN("Could not hang up non-existant call %s", callId.c_str()); + JAMI_WARN("Unable to hang up non-existant call %s", callId.c_str()); return false; } @@ -1507,21 +1507,21 @@ Manager::joinParticipant(const std::string& accountId, attached ? "YES" : "NO"); if (callId1 == callId2) { - JAMI_ERR("Cannot join participant %s to itself", callId1.c_str()); + JAMI_ERR("Unable to join participant %s to itself", callId1.c_str()); return false; } // Set corresponding conference ids for call 1 auto call1 = account->getCall(callId1); if (!call1) { - JAMI_ERR("Could not find call %s", callId1.c_str()); + JAMI_ERR("Unable to find call %s", callId1.c_str()); return false; } // Set corresponding conference details auto call2 = account2->getCall(callId2); if (!call2) { - JAMI_ERR("Could not find call %s", callId2.c_str()); + JAMI_ERR("Unable to find call %s", callId2.c_str()); return false; } @@ -1557,7 +1557,7 @@ Manager::createConfFromParticipantList(const std::string& accountId, { auto account = getAccount(accountId); if (not account) { - JAMI_WARN("Can't find account"); + JAMI_WARN("Unable to find account"); return; } @@ -1616,7 +1616,7 @@ Manager::detachParticipant(const std::string& callId) auto call = getCallFromCallID(callId); if (!call) { - JAMI_ERR("Could not find call %s", callId.c_str()); + JAMI_ERR("Unable to find call %s", callId.c_str()); return false; } @@ -1635,7 +1635,7 @@ Manager::removeParticipant(Call& call) auto conf = call.getConference(); if (not conf) { - JAMI_ERR("No conference, cannot remove participant"); + JAMI_ERR("No conference, unable to remove participant"); return; } @@ -1659,11 +1659,11 @@ Manager::joinConference(const std::string& accountId, auto account = getAccount(accountId); auto account2 = getAccount(account2Id); if (not account) { - JAMI_ERR("Can't find account: %s", accountId.c_str()); + JAMI_ERR("Unable to find account: %s", accountId.c_str()); return false; } if (not account2) { - JAMI_ERR("Can't find account: %s", account2Id.c_str()); + JAMI_ERR("Unable to find account: %s", account2Id.c_str()); return false; } @@ -1693,7 +1693,7 @@ Manager::joinConference(const std::string& accountId, removeAudio(*call); calls.emplace_back(std::move(call)); } else { - JAMI_ERROR("Could not find call {}", callId); + JAMI_ERROR("Unable to find call {}", callId); } } // Remove conf1 @@ -2351,7 +2351,7 @@ Manager::toggleRecordingCall(const std::string& accountId, const std::string& id JAMI_DBG("toggle recording for call %s", id.c_str()); rec = call; } else { - JAMI_ERR("Could not find recordable instance %s", id.c_str()); + JAMI_ERR("Unable to find recordable instance %s", id.c_str()); return false; } result = rec->toggleRecording(); @@ -2727,8 +2727,8 @@ Manager::getAccountDetails(const std::string& accountID) const if (account) { return account->getAccountDetails(); } else { - JAMI_ERR("Could not get account details on a non-existing accountID %s", accountID.c_str()); - // return an empty map since we can't throw an exception to D-Bus + JAMI_ERR("Unable to get account details on a non-existing accountID %s", accountID.c_str()); + // return an empty map since unable to throw an exception to D-Bus return {}; } } @@ -2741,7 +2741,7 @@ Manager::getVolatileAccountDetails(const std::string& accountID) const if (account) { return account->getVolatileAccountDetails(); } else { - JAMI_ERR("Could not get volatile account details on a non-existing accountID %s", + JAMI_ERR("Unable to get volatile account details on a non-existing accountID %s", accountID.c_str()); return {}; } @@ -2755,7 +2755,7 @@ Manager::setAccountDetails(const std::string& accountID, auto account = getAccount(accountID); if (not account) { - JAMI_ERR("Could not find account %s", accountID.c_str()); + JAMI_ERR("Unable to find account %s", accountID.c_str()); return; } @@ -2924,7 +2924,7 @@ Manager::loadAccountMap(const YAML::Node& node) a->setConfig(std::move(config)); } } catch (const std::exception& e) { - JAMI_ERR("Can't import account %s: %s", dir.c_str(), e.what()); + JAMI_ERR("Unable to import account %s: %s", dir.c_str(), e.what()); } } std::lock_guard l(lock); @@ -3081,7 +3081,7 @@ Manager::loadAccountAndConversation(const std::string& accountId, } if (!account) { - JAMI_WARN("Could not load account %s", accountId.c_str()); + JAMI_WARN("Unable to load account %s", accountId.c_str()); return; } if (auto jamiAcc = std::dynamic_pointer_cast<JamiAccount>(account)) { diff --git a/src/manager.h b/src/manager.h index 59f9270248135dd8e604c910fb15449daf39e83f..d49b9a5547b46938dfe53bb8b16da3afd6823205 100644 --- a/src/manager.h +++ b/src/manager.h @@ -649,7 +649,7 @@ public: void playDtmf(char code); /** - * Handle played sound when a call can not be conpleted because of a busy recipient + * Handle played sound when a call is unable to be completed because of a busy recipient */ void callBusy(Call& call); diff --git a/src/media/audio/alsa/alsalayer.cpp b/src/media/audio/alsa/alsalayer.cpp index c5f753ac21f1abf2a70cd55c04bebef6c3c2adc0..d4748e1ab77e32678eba69b0bf070f7a350da68e 100644 --- a/src/media/audio/alsa/alsalayer.cpp +++ b/src/media/audio/alsa/alsalayer.cpp @@ -106,7 +106,7 @@ AlsaLayer::openDevice(snd_pcm_t** pcm, } while (err == -EBUSY and ++tries <= MAX_RETRIES); if (err < 0) { - JAMI_ERR("Alsa: couldn't open %s device %s : %s", + JAMI_ERR("Alsa: Unable to open %s device %s : %s", (stream == SND_PCM_STREAM_CAPTURE) ? "capture" : (stream == SND_PCM_STREAM_PLAYBACK) ? "playback" : "ringtone", @@ -230,7 +230,7 @@ AlsaLayer::stopThread() void AlsaLayer::stopCaptureStream() { - if (captureHandle_ && ALSA_CALL(snd_pcm_drop(captureHandle_), "couldn't stop capture") >= 0) { + if (captureHandle_ && ALSA_CALL(snd_pcm_drop(captureHandle_), "Unable to stop capture") >= 0) { is_capture_running_ = false; is_capture_prepared_ = false; } @@ -244,7 +244,7 @@ AlsaLayer::closeCaptureStream() JAMI_DBG("Alsa: Closing capture stream"); if (is_capture_open_ - && ALSA_CALL(snd_pcm_close(captureHandle_), "Couldn't close capture") >= 0) { + && ALSA_CALL(snd_pcm_close(captureHandle_), "Unable to close capture") >= 0) { is_capture_open_ = false; captureHandle_ = nullptr; } @@ -254,7 +254,7 @@ void AlsaLayer::startCaptureStream() { if (captureHandle_ and not is_capture_running_) - if (ALSA_CALL(snd_pcm_start(captureHandle_), "Couldn't start capture") >= 0) + if (ALSA_CALL(snd_pcm_start(captureHandle_), "Unable to start capture") >= 0) is_capture_running_ = true; } @@ -262,7 +262,7 @@ void AlsaLayer::stopPlaybackStream() { if (playbackHandle_ and is_playback_running_) { - if (ALSA_CALL(snd_pcm_drop(playbackHandle_), "Couldn't stop playback") >= 0) { + if (ALSA_CALL(snd_pcm_drop(playbackHandle_), "Unable to stop playback") >= 0) { is_playback_running_ = false; } } @@ -286,8 +286,8 @@ void AlsaLayer::closeRingtoneStream() { if (ringtoneHandle_) { - ALSA_CALL(snd_pcm_drop(ringtoneHandle_), "Couldn't stop ringtone"); - ALSA_CALL(snd_pcm_close(ringtoneHandle_), "Couldn't close ringtone"); + ALSA_CALL(snd_pcm_drop(ringtoneHandle_), "Unable to stop ringtone"); + ALSA_CALL(snd_pcm_close(ringtoneHandle_), "Unable to close ringtone"); ringtoneHandle_ = nullptr; } } @@ -302,7 +302,7 @@ void AlsaLayer::prepareCaptureStream() { if (is_capture_open_ and not is_capture_prepared_) - if (ALSA_CALL(snd_pcm_prepare(captureHandle_), "Couldn't prepare capture") >= 0) + if (ALSA_CALL(snd_pcm_prepare(captureHandle_), "Unable to prepare capture") >= 0) is_capture_prepared_ = true; } @@ -373,7 +373,7 @@ AlsaLayer::alsa_set_params(snd_pcm_t* pcm_handle, AudioFormat& format) JAMI_DBG("Was set buffer_size = %lu", buffer_size); if (2 * period_size > buffer_size) { - JAMI_ERR("buffer to small, could not use"); + JAMI_ERR("buffer to small, unable to use"); return false; } @@ -419,7 +419,7 @@ AlsaLayer::write(const AudioFrame& buffer, snd_pcm_t* handle) snd_pcm_status_t* status; snd_pcm_status_alloca(&status); - if (ALSA_CALL(snd_pcm_status(handle, status), "Cannot get playback handle status") >= 0) + if (ALSA_CALL(snd_pcm_status(handle, status), "Unable to get playback handle status") >= 0) if (snd_pcm_status_get_state(status) == SND_PCM_STATE_XRUN) { stopPlaybackStream(); startPlaybackStream(); @@ -436,7 +436,7 @@ AlsaLayer::write(const AudioFrame& buffer, snd_pcm_t* handle) snd_pcm_status_t* status; snd_pcm_status_alloca(&status); - if (ALSA_CALL(snd_pcm_status(handle, status), "Cannot get playback handle status") >= 0) { + if (ALSA_CALL(snd_pcm_status(handle, status), "Unable to get playback handle status") >= 0) { if (snd_pcm_status_get_state(status) == SND_PCM_STATE_SETUP) { JAMI_ERR("Writing in state SND_PCM_STATE_SETUP, should be " "SND_PCM_STATE_PREPARED or SND_PCM_STATE_RUNNING"); @@ -494,7 +494,7 @@ AlsaLayer::read(unsigned frames) } case -EPERM: - JAMI_ERR("Can't capture, EPERM (%s)", snd_strerror(err)); + JAMI_ERR("Unable to capture, EPERM (%s)", snd_strerror(err)); prepareCaptureStream(); startCaptureStream(); break; @@ -581,7 +581,7 @@ AlsaLayer::getAudioDeviceIndexMap(bool getCapture) const int err; if ((err = snd_ctl_pcm_info(handle, pcminfo)) < 0) { - JAMI_WARN("Cannot get info for %s %s: %s", + JAMI_WARN("Unable to get info for %s %s: %s", getCapture ? "capture device" : "playback device", name.c_str(), snd_strerror(err)); @@ -677,7 +677,7 @@ AlsaLayer::capture() if (auto r = read(toGetFrames)) { putRecorded(std::move(r)); } else - JAMI_ERR("ALSA MIC : Couldn't read!"); + JAMI_ERR("ALSA MIC : Unable to read!"); } void diff --git a/src/media/audio/audio-processing/audio_processor.h b/src/media/audio/audio-processing/audio_processor.h index df0ed97cfada537aa21f0bca07d700ad58611be4..ce35287cbfa716d221345e0818726dad95824e08 100644 --- a/src/media/audio/audio-processing/audio_processor.h +++ b/src/media/audio/audio-processing/audio_processor.h @@ -1,189 +1,189 @@ -/* - * Copyright (C) 2021-2024 Savoir-faire Linux Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#pragma once - -#include "noncopyable.h" -#include "media/audio/audio_frame_resizer.h" -#include "media/audio/resampler.h" -#include "media/audio/audio_format.h" -#include "media/libav_deps.h" -#include "logger.h" - -#include <atomic> -#include <memory> - -namespace jami { - -class AudioProcessor -{ -private: - NON_COPYABLE(AudioProcessor); - -public: - AudioProcessor(AudioFormat format, unsigned frameSize) - : playbackQueue_(format, (int) frameSize) - , recordQueue_(format, (int) frameSize) - , resampler_(new Resampler) - , format_(format) - , frameSize_(frameSize) - , frameDurationMs_((unsigned int) (frameSize_ * (1.0 / format_.sample_rate) * 1000)) - {} - virtual ~AudioProcessor() = default; - - virtual void putRecorded(std::shared_ptr<AudioFrame>&& buf) - { - recordStarted_ = true; - if (!playbackStarted_) - return; - enqueue(recordQueue_, std::move(buf)); - }; - virtual void putPlayback(const std::shared_ptr<AudioFrame>& buf) - { - playbackStarted_ = true; - if (!recordStarted_) - return; - auto copy = buf; - enqueue(playbackQueue_, std::move(copy)); - }; - - /** - * @brief Process and return a single AudioFrame - */ - virtual std::shared_ptr<AudioFrame> getProcessed() = 0; - - /** - * @brief Set the status of echo cancellation - */ - virtual void enableEchoCancel(bool enabled) = 0; - - /** - * @brief Set the status of noise suppression - * includes de-reverb, de-noise, high pass filter, etc - */ - virtual void enableNoiseSuppression(bool enabled) = 0; - - /** - * @brief Set the status of automatic gain control - */ - virtual void enableAutomaticGainControl(bool enabled) = 0; - - /** - * @brief Set the status of voice activity detection - */ - virtual void enableVoiceActivityDetection(bool enabled) = 0; - -protected: - AudioFrameResizer playbackQueue_; - AudioFrameResizer recordQueue_; - std::unique_ptr<Resampler> resampler_; - std::atomic_bool playbackStarted_; - std::atomic_bool recordStarted_; - AudioFormat format_; - unsigned int frameSize_; - unsigned int frameDurationMs_; - - // artificially extend voice activity by this long - unsigned int forceMinimumVoiceActivityMs {1000}; - - // current number of frames to force the voice activity to be true - unsigned int forceVoiceActiveFramesLeft {0}; - - // voice activity must be active for this long _before_ it is considered legitimate - unsigned int minimumConsequtiveDurationMs {200}; - - // current number of frames that the voice activity has been true - unsigned int consecutiveActiveFrames {0}; - - /** - * @brief Helper method for audio processors, should be called at start of getProcessed() - * Pops frames from audio queues if there's overflow - * @returns True if there is underflow, false otherwise. An AudioProcessor should - * return a blank AudioFrame if there is underflow. - */ - bool tidyQueues() - { - auto recordFrameSize = recordQueue_.frameSize(); - auto playbackFrameSize = playbackQueue_.frameSize(); - while (recordQueue_.samples() > recordFrameSize * 10 - && 2 * playbackQueue_.samples() * recordFrameSize < recordQueue_.samples() * playbackFrameSize) { - JAMI_LOG("record overflow {:d} / {:d} - playback: {:d}", recordQueue_.samples(), frameSize_, playbackQueue_.samples()); - recordQueue_.dequeue(); - } - while (playbackQueue_.samples() > playbackFrameSize * 10 - && 2 * recordQueue_.samples() * playbackFrameSize < playbackQueue_.samples() * recordFrameSize) { - JAMI_LOG("playback overflow {:d} / {:d} - record: {:d}", playbackQueue_.samples(), frameSize_, recordQueue_.samples()); - playbackQueue_.dequeue(); - } - if (recordQueue_.samples() < recordFrameSize - || playbackQueue_.samples() < playbackFrameSize) { - // If there are not enough samples in either queue, we can't - // process anything. - return true; - } - return false; - } - - /** - * @brief Stablilizes voice activity - * @param voiceStatus the voice status that was detected by the audio processor - * for the current frame - * @returns The voice activity status that should be set on the current frame - */ - bool getStabilizedVoiceActivity(bool voiceStatus) - { - bool newVoice = false; - - if (voiceStatus) { - // we detected activity - consecutiveActiveFrames += 1; - - // make sure that we have been active for necessary time - if (consecutiveActiveFrames > minimumConsequtiveDurationMs / frameDurationMs_) { - newVoice = true; - - // set number of frames that will be forced positive - forceVoiceActiveFramesLeft = (int) forceMinimumVoiceActivityMs / frameDurationMs_; - } - } else if (forceVoiceActiveFramesLeft > 0) { - // if we didn't detect voice, but we haven't elapsed the minimum duration, - // force voice to be true - newVoice = true; - forceVoiceActiveFramesLeft -= 1; - - consecutiveActiveFrames += 1; - } else { - // else no voice and no need to force - newVoice = false; - consecutiveActiveFrames = 0; - } - - return newVoice; - } - -private: - void enqueue(AudioFrameResizer& frameResizer, std::shared_ptr<AudioFrame>&& buf) - { - if (buf->getFormat() != format_) { - frameResizer.enqueue(resampler_->resample(std::move(buf), format_)); - } else - frameResizer.enqueue(std::move(buf)); - }; -}; - -} // namespace jami +/* + * Copyright (C) 2021-2024 Savoir-faire Linux Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#pragma once + +#include "noncopyable.h" +#include "media/audio/audio_frame_resizer.h" +#include "media/audio/resampler.h" +#include "media/audio/audio_format.h" +#include "media/libav_deps.h" +#include "logger.h" + +#include <atomic> +#include <memory> + +namespace jami { + +class AudioProcessor +{ +private: + NON_COPYABLE(AudioProcessor); + +public: + AudioProcessor(AudioFormat format, unsigned frameSize) + : playbackQueue_(format, (int) frameSize) + , recordQueue_(format, (int) frameSize) + , resampler_(new Resampler) + , format_(format) + , frameSize_(frameSize) + , frameDurationMs_((unsigned int) (frameSize_ * (1.0 / format_.sample_rate) * 1000)) + {} + virtual ~AudioProcessor() = default; + + virtual void putRecorded(std::shared_ptr<AudioFrame>&& buf) + { + recordStarted_ = true; + if (!playbackStarted_) + return; + enqueue(recordQueue_, std::move(buf)); + }; + virtual void putPlayback(const std::shared_ptr<AudioFrame>& buf) + { + playbackStarted_ = true; + if (!recordStarted_) + return; + auto copy = buf; + enqueue(playbackQueue_, std::move(copy)); + }; + + /** + * @brief Process and return a single AudioFrame + */ + virtual std::shared_ptr<AudioFrame> getProcessed() = 0; + + /** + * @brief Set the status of echo cancellation + */ + virtual void enableEchoCancel(bool enabled) = 0; + + /** + * @brief Set the status of noise suppression + * includes de-reverb, de-noise, high pass filter, etc + */ + virtual void enableNoiseSuppression(bool enabled) = 0; + + /** + * @brief Set the status of automatic gain control + */ + virtual void enableAutomaticGainControl(bool enabled) = 0; + + /** + * @brief Set the status of voice activity detection + */ + virtual void enableVoiceActivityDetection(bool enabled) = 0; + +protected: + AudioFrameResizer playbackQueue_; + AudioFrameResizer recordQueue_; + std::unique_ptr<Resampler> resampler_; + std::atomic_bool playbackStarted_; + std::atomic_bool recordStarted_; + AudioFormat format_; + unsigned int frameSize_; + unsigned int frameDurationMs_; + + // artificially extend voice activity by this long + unsigned int forceMinimumVoiceActivityMs {1000}; + + // current number of frames to force the voice activity to be true + unsigned int forceVoiceActiveFramesLeft {0}; + + // voice activity must be active for this long _before_ it is considered legitimate + unsigned int minimumConsequtiveDurationMs {200}; + + // current number of frames that the voice activity has been true + unsigned int consecutiveActiveFrames {0}; + + /** + * @brief Helper method for audio processors, should be called at start of getProcessed() + * Pops frames from audio queues if there's overflow + * @returns True if there is underflow, false otherwise. An AudioProcessor should + * return a blank AudioFrame if there is underflow. + */ + bool tidyQueues() + { + auto recordFrameSize = recordQueue_.frameSize(); + auto playbackFrameSize = playbackQueue_.frameSize(); + while (recordQueue_.samples() > recordFrameSize * 10 + && 2 * playbackQueue_.samples() * recordFrameSize < recordQueue_.samples() * playbackFrameSize) { + JAMI_LOG("record overflow {:d} / {:d} - playback: {:d}", recordQueue_.samples(), frameSize_, playbackQueue_.samples()); + recordQueue_.dequeue(); + } + while (playbackQueue_.samples() > playbackFrameSize * 10 + && 2 * recordQueue_.samples() * playbackFrameSize < playbackQueue_.samples() * recordFrameSize) { + JAMI_LOG("playback overflow {:d} / {:d} - record: {:d}", playbackQueue_.samples(), frameSize_, recordQueue_.samples()); + playbackQueue_.dequeue(); + } + if (recordQueue_.samples() < recordFrameSize + || playbackQueue_.samples() < playbackFrameSize) { + // If there are not enough samples in either queue, we are unable to + // process anything. + return true; + } + return false; + } + + /** + * @brief Stablilizes voice activity + * @param voiceStatus the voice status that was detected by the audio processor + * for the current frame + * @returns The voice activity status that should be set on the current frame + */ + bool getStabilizedVoiceActivity(bool voiceStatus) + { + bool newVoice = false; + + if (voiceStatus) { + // we detected activity + consecutiveActiveFrames += 1; + + // make sure that we have been active for necessary time + if (consecutiveActiveFrames > minimumConsequtiveDurationMs / frameDurationMs_) { + newVoice = true; + + // set number of frames that will be forced positive + forceVoiceActiveFramesLeft = (int) forceMinimumVoiceActivityMs / frameDurationMs_; + } + } else if (forceVoiceActiveFramesLeft > 0) { + // if we didn't detect voice, but we haven't elapsed the minimum duration, + // force voice to be true + newVoice = true; + forceVoiceActiveFramesLeft -= 1; + + consecutiveActiveFrames += 1; + } else { + // else no voice and no need to force + newVoice = false; + consecutiveActiveFrames = 0; + } + + return newVoice; + } + +private: + void enqueue(AudioFrameResizer& frameResizer, std::shared_ptr<AudioFrame>&& buf) + { + if (buf->getFormat() != format_) { + frameResizer.enqueue(resampler_->resample(std::move(buf), format_)); + } else + frameResizer.enqueue(std::move(buf)); + }; +}; + +} // namespace jami diff --git a/src/media/audio/audio_frame_resizer.cpp b/src/media/audio/audio_frame_resizer.cpp index 140a9f3c000bd11a547acbd1c868c3965d0d1ece..dc3a6b133e2aa56af11de914228f9308be1bf4e9 100644 --- a/src/media/audio/audio_frame_resizer.cpp +++ b/src/media/audio/audio_frame_resizer.cpp @@ -137,7 +137,7 @@ AudioFrameResizer::dequeue() reinterpret_cast<void**>(frame->pointer()->data), frameSize_)) < 0) { - JAMI_ERR() << "Could not read samples from queue: " << libav_utils::getError(ret); + JAMI_ERR() << "Unable to read samples from queue: " << libav_utils::getError(ret); return {}; } frame->pointer()->pts = nextOutputPts_; diff --git a/src/media/audio/audio_input.cpp b/src/media/audio/audio_input.cpp index 76ce5139be9741cf7984364ee8db1c78bf8ae28c..408c74e710b2cf5ffe896ad00d270b86f2fe3416 100644 --- a/src/media/audio/audio_input.cpp +++ b/src/media/audio/audio_input.cpp @@ -263,7 +263,7 @@ AudioInput::initFile(const std::string& path) devOpts_.loop = "1"; // sets devOpts_'s sample rate and number of channels if (!createDecoder()) { - JAMI_WARN() << "Cannot decode audio from file, switching back to default device"; + JAMI_WARN() << "Unable to decode audio from file, switching back to default device"; return initDevice(""); } wakeUp_ = std::chrono::steady_clock::now() + MS_PER_PACKET; @@ -376,13 +376,13 @@ AudioInput::createDecoder() [](void* data) -> int { return not static_cast<AudioInput*>(data)->isCapturing(); }, this); if (decoder->openInput(devOpts_) < 0) { - JAMI_ERR() << "Could not open input '" << devOpts_.input << "'"; + JAMI_ERR() << "Unable to open input '" << devOpts_.input << "'"; foundDevOpts(devOpts_); return false; } if (decoder->setupAudio() < 0) { - JAMI_ERR() << "Could not setup decoder for '" << devOpts_.input << "'"; + JAMI_ERR() << "Unable to setup decoder for '" << devOpts_.input << "'"; foundDevOpts(devOpts_); return false; } diff --git a/src/media/audio/audio_receive_thread.cpp b/src/media/audio/audio_receive_thread.cpp index 10e446660ac6c864a2797f22e66fdaa8a0aec3e9..682a3fda01c69e809b06a39f30a086adc3089db4 100644 --- a/src/media/audio/audio_receive_thread.cpp +++ b/src/media/audio/audio_receive_thread.cpp @@ -79,7 +79,7 @@ AudioReceiveThread::setup() audioDecoder_->setIOContext(sdpContext_.get()); audioDecoder_->setFEC(true); if (audioDecoder_->openInput(args_)) { - JAMI_ERR("Could not open input \"%s\"", SDP_FILENAME); + JAMI_ERR("Unable to open input \"%s\"", SDP_FILENAME); return false; } diff --git a/src/media/audio/audio_sender.cpp b/src/media/audio/audio_sender.cpp index 2b602b826bd92a1cc4bb7712a6c6432f0d950f75..a42402b5e8f21d83812248aaf6887b86030de95c 100644 --- a/src/media/audio/audio_sender.cpp +++ b/src/media/audio/audio_sender.cpp @@ -109,7 +109,7 @@ AudioSender::setVoiceCallback(std::function<void(bool)> cb) if (cb) { voiceCallback_ = std::move(cb); } else { - JAMI_ERR("AudioSender trying to set invalid voice callback"); + JAMI_ERR("AudioSender attempting to set invalid voice callback"); } } diff --git a/src/media/audio/coreaudio/ios/corelayer.mm b/src/media/audio/coreaudio/ios/corelayer.mm index 8d9157b4858eee21c8a7cf27661b6564e6d846a4..0a50b7b4402836ea2be561f0d650c0fb4d3d52d0 100644 --- a/src/media/audio/coreaudio/ios/corelayer.mm +++ b/src/media/audio/coreaudio/ios/corelayer.mm @@ -137,7 +137,7 @@ CoreLayer::initAudioLayerIO(AudioDeviceType stream) auto comp = AudioComponentFindNext(nullptr, &outputUnitDescription); if (comp == nullptr) { - JAMI_ERR("Can't find default output audio component."); + JAMI_ERR("Unable to find default output audio component."); return false; } diff --git a/src/media/audio/coreaudio/osx/corelayer.mm b/src/media/audio/coreaudio/osx/corelayer.mm index 0c38fb2d0445efb0b16e3b4b0f637afb946638d4..eb74308335c8664a22b8ab5b6c77273b900b0303 100644 --- a/src/media/audio/coreaudio/osx/corelayer.mm +++ b/src/media/audio/coreaudio/osx/corelayer.mm @@ -145,7 +145,7 @@ CoreLayer::initAudioLayerIO(AudioDeviceType stream) auto comp = AudioComponentFindNext(nullptr, &desc); if (comp == nullptr) { - JAMI_ERR("Can't find default output audio component."); + JAMI_ERR("Unable to find default output audio component."); return; } diff --git a/src/media/audio/jack/jacklayer.cpp b/src/media/audio/jack/jacklayer.cpp index f0ede117bca5f9f3103a71f7e5e072659dc31bdb..d84af590fd39651923b15fe3be6bd8bb4eefb65f 100644 --- a/src/media/audio/jack/jacklayer.cpp +++ b/src/media/audio/jack/jacklayer.cpp @@ -54,12 +54,12 @@ connectPorts(jack_client_t* client, int portType, const std::vector<jack_port_t* const char* port = jack_port_name(ports[i]); if (portType & JackPortIsInput) { if (jack_connect(client, port, physical_ports[i])) { - JAMI_ERR("Can't connect %s to %s", port, physical_ports[i]); + JAMI_ERR("Unable to connect %s to %s", port, physical_ports[i]); break; } } else { if (jack_connect(client, physical_ports[i], port)) { - JAMI_ERR("Can't connect port %s to %s", physical_ports[i], port); + JAMI_ERR("Unable to connect port %s to %s", physical_ports[i], port); break; } } @@ -201,15 +201,15 @@ createPorts(jack_client_t* client, playback ? JackPortIsOutput : JackPortIsInput, 0); if (port == nullptr) - throw std::runtime_error("Could not register JACK output port"); + throw std::runtime_error("Unable to register JACK output port"); ports.push_back(port); static const unsigned RB_SIZE = 16384; jack_ringbuffer_t* rb = jack_ringbuffer_create(RB_SIZE); if (rb == nullptr) - throw std::runtime_error("Could not create JACK ringbuffer"); + throw std::runtime_error("Unable to create JACK ringbuffer"); if (jack_ringbuffer_mlock(rb)) - throw std::runtime_error("Could not lock JACK ringbuffer in memory"); + throw std::runtime_error("Unable to lock JACK ringbuffer in memory"); ringbuffers.push_back(rb); } jack_free(physical_ports); @@ -224,13 +224,13 @@ JackLayer::JackLayer(const AudioPreference& p) (jack_options_t)(JackNullOption | JackNoStartServer), NULL); if (!playbackClient_) - throw std::runtime_error("Could not open JACK client"); + throw std::runtime_error("Unable to open JACK client"); captureClient_ = jack_client_open(PACKAGE_NAME, (jack_options_t)(JackNullOption | JackNoStartServer), NULL); if (!captureClient_) - throw std::runtime_error("Could not open JACK client"); + throw std::runtime_error("Unable to open JACK client"); jack_set_process_callback(captureClient_, process_capture, this); jack_set_process_callback(playbackClient_, process_playback, this); @@ -257,9 +257,9 @@ JackLayer::~JackLayer() jack_port_unregister(captureClient_, p); if (jack_client_close(playbackClient_)) - JAMI_ERR("JACK client could not close"); + JAMI_ERR("Unable to close JACK client"); if (jack_client_close(captureClient_)) - JAMI_ERR("JACK client could not close"); + JAMI_ERR("Unable to close JACK client"); for (auto r : out_ringbuffers_) jack_ringbuffer_free(r); @@ -336,7 +336,7 @@ JackLayer::process_capture(jack_nframes_t frames, void* arg) } /* Tell the ringbuffer thread there is work to do. If it is already - * running, the lock will not be available. We can't wait + * running, the lock will not be available. We are unable to wait * here in the process() thread, but we don't need to signal * in that case, because the ringbuffer thread will read all the * data queued before waiting again. */ @@ -384,7 +384,7 @@ void JackLayer::startStream(AudioDeviceType) status_ = Status::Started; if (jack_activate(playbackClient_) or jack_activate(captureClient_)) { - JAMI_ERR("Could not activate JACK client"); + JAMI_ERR("Unable to activate JACK client"); return; } ringbuffer_thread_ = std::thread(&JackLayer::ringbuffer_worker, this); @@ -411,7 +411,7 @@ void JackLayer::stopStream(AudioDeviceType) data_ready_.notify_one(); if (jack_deactivate(playbackClient_) or jack_deactivate(captureClient_)) { - JAMI_ERR("JACK client could not deactivate"); + JAMI_ERR("Unable to deactivate JACK client"); } if (ringbuffer_thread_.joinable()) diff --git a/src/media/audio/portaudio/portaudiolayer.cpp b/src/media/audio/portaudio/portaudiolayer.cpp index ca82a03d278046fed0f88e468ba6f06eec2e1df4..539b33e0ac660bd09374627f5789b5d3a4305dbe 100644 --- a/src/media/audio/portaudio/portaudiolayer.cpp +++ b/src/media/audio/portaudio/portaudiolayer.cpp @@ -215,12 +215,12 @@ PortAudioLayer::stopStream(AudioDeviceType stream) return false; auto err = Pa_StopStream(stream); if (err != paNoError) { - JAMI_ERR("Pa_StopStream error : %s", Pa_GetErrorText(err)); + JAMI_ERR("Pa_StopStream error: %s", Pa_GetErrorText(err)); return false; } err = Pa_CloseStream(stream); if (err != paNoError) { - JAMI_ERR("Pa_CloseStream error : %s", Pa_GetErrorText(err)); + JAMI_ERR("Pa_CloseStream error: %s", Pa_GetErrorText(err)); return false; } return true; @@ -325,7 +325,7 @@ PortAudioLayer::PortAudioLayerImpl::initInput(PortAudioLayer& parent) const auto inputDeviceInfo = Pa_GetDeviceInfo(apiIndex); if (!inputDeviceInfo) { // this represents complete failure after attempting a fallback to default - JAMI_WARN("PortAudioLayer could not initialize input"); + JAMI_WARN("PortAudioLayer was unable to initialize input"); deviceRecord_.clear(); inputInitialized_ = true; return; @@ -335,7 +335,7 @@ PortAudioLayer::PortAudioLayerImpl::initInput(PortAudioLayer& parent) // internal index to paNoDevice and reenter in an attempt to set the default // communications device if (inputDeviceInfo->maxInputChannels <= 0) { - JAMI_WARN("PortAudioLayer could not initialize input, falling back to default device"); + JAMI_WARN("PortAudioLayer was unable to initialize input, falling back to default device"); deviceRecord_.clear(); return initInput(parent); } @@ -364,7 +364,7 @@ PortAudioLayer::PortAudioLayerImpl::initOutput(PortAudioLayer& parent) const auto outputDeviceInfo = Pa_GetDeviceInfo(apiIndex); if (!outputDeviceInfo) { // this represents complete failure after attempting a fallback to default - JAMI_WARN("PortAudioLayer could not initialize output"); + JAMI_WARN("PortAudioLayer was unable to initialize output"); devicePlayback_.clear(); outputInitialized_ = true; return; @@ -374,7 +374,7 @@ PortAudioLayer::PortAudioLayerImpl::initOutput(PortAudioLayer& parent) // internal index to paNoDevice and reenter in an attempt to set the default // communications device if (outputDeviceInfo->maxOutputChannels <= 0) { - JAMI_WARN("PortAudioLayer could not initialize output, falling back to default device"); + JAMI_WARN("PortAudioLayer was unable to initialize output, falling back to default device"); devicePlayback_.clear(); return initOutput(parent); } @@ -398,7 +398,7 @@ PortAudioLayer::PortAudioLayerImpl::init(PortAudioLayer& parent) auto apiIndex = Pa_GetDefaultHostApi(); auto apiInfo = Pa_GetHostApiInfo(apiIndex); if (err != paNoError || apiInfo == nullptr) { - JAMI_ERR("PortAudioLayer error : %s", Pa_GetErrorText(err)); + JAMI_ERR("PortAudioLayer error: %s", Pa_GetErrorText(err)); terminate(); return; } @@ -418,7 +418,7 @@ PortAudioLayer::PortAudioLayerImpl::getDevicesByType(AudioDeviceType type) const std::vector<std::string> devices; auto numDevices = Pa_GetDeviceCount(); if (numDevices < 0) - JAMI_ERR("PortAudioLayer error : %s", Pa_GetErrorText(numDevices)); + JAMI_ERR("PortAudioLayer error: %s", Pa_GetErrorText(numDevices)); else { for (int i = 0; i < numDevices; i++) { const auto deviceInfo = Pa_GetDeviceInfo(i); @@ -473,7 +473,7 @@ PortAudioLayer::PortAudioLayerImpl::getApiIndexByType(AudioDeviceType type) { auto numDevices = Pa_GetDeviceCount(); if (numDevices < 0) - JAMI_ERR("PortAudioLayer error : %s", Pa_GetErrorText(numDevices)); + JAMI_ERR("PortAudioLayer error: %s", Pa_GetErrorText(numDevices)); else { std::string_view toMatch = (type == AudioDeviceType::CAPTURE ? deviceRecord_ @@ -515,7 +515,7 @@ PortAudioLayer::PortAudioLayerImpl::terminate() const JAMI_DBG("PortAudioLayer terminate."); auto err = Pa_Terminate(); if (err != paNoError) - JAMI_ERR("PortAudioLayer error : %s", Pa_GetErrorText(err)); + JAMI_ERR("PortAudioLayer error: %s", Pa_GetErrorText(err)); } static void @@ -546,7 +546,7 @@ openStreamDevice(PaStream** stream, user_data); if (err != paNoError) - JAMI_ERR("PortAudioLayer error : %s", Pa_GetErrorText(err)); + JAMI_ERR("PortAudioLayer error: %s", Pa_GetErrorText(err)); } static void @@ -584,7 +584,7 @@ openFullDuplexStream(PaStream** stream, user_data); if (err != paNoError) - JAMI_ERR("PortAudioLayer error : %s", Pa_GetErrorText(err)); + JAMI_ERR("PortAudioLayer error: %s", Pa_GetErrorText(err)); } bool @@ -621,7 +621,7 @@ PortAudioLayer::PortAudioLayerImpl::initInputStream(PortAudioLayer& parent) JAMI_DBG("Starting PortAudio Input Stream"); auto err = Pa_StartStream(stream); if (err != paNoError) { - JAMI_ERR("PortAudioLayer error : %s", Pa_GetErrorText(err)); + JAMI_ERR("PortAudioLayer error: %s", Pa_GetErrorText(err)); return false; } @@ -663,7 +663,7 @@ PortAudioLayer::PortAudioLayerImpl::initOutputStream(PortAudioLayer& parent) JAMI_DBG("Starting PortAudio Output Stream"); auto err = Pa_StartStream(stream); if (err != paNoError) { - JAMI_ERR("PortAudioLayer error : %s", Pa_GetErrorText(err)); + JAMI_ERR("PortAudioLayer error: %s", Pa_GetErrorText(err)); return false; } @@ -706,7 +706,7 @@ PortAudioLayer::PortAudioLayerImpl::initFullDuplexStream(PortAudioLayer& parent) JAMI_DBG("Start PortAudio I/O Streams"); auto err = Pa_StartStream(stream); if (err != paNoError) { - JAMI_ERR("PortAudioLayer error : %s", Pa_GetErrorText(err)); + JAMI_ERR("PortAudioLayer error: %s", Pa_GetErrorText(err)); return false; } diff --git a/src/media/audio/pulseaudio/audiostream.cpp b/src/media/audio/pulseaudio/audiostream.cpp index dae54014f4f20d8bd3fade8199d4eb098fb52a38..a64a1f88fcda540cd32376cd0e8415bdef78f451 100644 --- a/src/media/audio/pulseaudio/audiostream.cpp +++ b/src/media/audio/pulseaudio/audiostream.cpp @@ -81,7 +81,7 @@ AudioStream::AudioStream(pa_context* c, ec ? pl.get() : nullptr); if (!audiostream_) { JAMI_ERR("%s: pa_stream_new() failed : %s", desc, pa_strerror(pa_context_errno(c))); - throw std::runtime_error("Could not create stream\n"); + throw std::runtime_error("Unable to create stream\n"); } pa_buffer_attr attributes; diff --git a/src/media/audio/pulseaudio/pulselayer.cpp b/src/media/audio/pulseaudio/pulselayer.cpp index 5dcf0f1345e8fb482860333d0a4a1667b0dfbf65..d3dde0b91985f36570e40cbe7d9ae5243568868b 100644 --- a/src/media/audio/pulseaudio/pulselayer.cpp +++ b/src/media/audio/pulseaudio/pulselayer.cpp @@ -68,7 +68,7 @@ PulseLayer::PulseLayer(AudioPreference& pref) { JAMI_INFO("[audiolayer] created pulseaudio layer"); if (!mainloop_) - throw std::runtime_error("Couldn't create pulseaudio mainloop"); + throw std::runtime_error("Unable to create pulseaudio mainloop"); if (pa_threaded_mainloop_start(mainloop_.get()) < 0) throw std::runtime_error("Failed to start pulseaudio mainloop"); @@ -85,12 +85,12 @@ PulseLayer::PulseLayer(AudioPreference& pref) PACKAGE_NAME, pl.get()); if (!context_) - throw std::runtime_error("Couldn't create pulseaudio context"); + throw std::runtime_error("Unable to create pulseaudio context"); pa_context_set_state_callback(context_, context_state_callback, this); if (pa_context_connect(context_, nullptr, PA_CONTEXT_NOFLAGS, nullptr) < 0) - throw std::runtime_error("Could not connect pulseaudio context to the server"); + throw std::runtime_error("Unable to connect pulseaudio context to the server"); // wait until context is ready for (;;) { diff --git a/src/media/audio/resampler.cpp b/src/media/audio/resampler.cpp index 688d5c8f060369f3120dc93d3dfb6faf0c963f6b..46e7e9a523ee940f1a5f9e5ca2617c6634241086 100644 --- a/src/media/audio/resampler.cpp +++ b/src/media/audio/resampler.cpp @@ -46,7 +46,7 @@ Resampler::reinit(const AVFrame* in, const AVFrame* out) // NOTE swr_set_matrix should be called on an uninitialized context auto swrCtx = swr_alloc(); if (!swrCtx) { - JAMI_ERR() << "Cannot allocate resampler context"; + JAMI_ERR() << "Unable to allocate resampler context"; throw std::bad_alloc(); } @@ -59,8 +59,8 @@ Resampler::reinit(const AVFrame* in, const AVFrame* out) av_opt_set_sample_fmt(swrCtx, "osf", static_cast<AVSampleFormat>(out->format), 0); /** - * Downmixing from 5.1 requires extra setup, since libswresample can't do it automatically - * (not yet implemented). + * Downmixing from 5.1 requires extra setup, since libswresample is unable to do it + * automatically (not yet implemented). * * Source: https://www.atsc.org/wp-content/uploads/2015/03/A52-201212-17.pdf * Section 7.8.2 for the algorithm @@ -71,7 +71,7 @@ Resampler::reinit(const AVFrame* in, const AVFrame* out) */ if (in->ch_layout.u.mask == AV_CH_LAYOUT_5POINT1 || in->ch_layout.u.mask == AV_CH_LAYOUT_5POINT1_BACK) { - // NOTE MSVC can't allocate dynamic size arrays on the stack + // NOTE: MSVC is unable to allocate dynamic size arrays on the stack if (out->ch_layout.nb_channels == 2) { double matrix[2][6]; // L = 1.0*FL + 0.707*FC + 0.707*BL + 1.0*LFE diff --git a/src/media/audio/resampler.h b/src/media/audio/resampler.h index 8529185232bd85a1ad664cb738c65e62d50b12ba..26e34edf420131f0842e4fb5abc4b31efc33fe90 100644 --- a/src/media/audio/resampler.h +++ b/src/media/audio/resampler.h @@ -77,7 +77,7 @@ private: /** * @brief Libswresample resampler context. * - * NOTE SwrContext is an imcomplete type and cannot be stored in a smart pointer. + * NOTE SwrContext is an incomplete type and is unable to be stored in a smart pointer. */ SwrContext* swrCtx_; diff --git a/src/media/audio/sound/audiofile.cpp b/src/media/audio/sound/audiofile.cpp index e5fd4387f905a3221e7c40444c43a722dea9d4d2..c4d46511a7d379b7692a016e966eff2a0562387c 100644 --- a/src/media/audio/sound/audiofile.cpp +++ b/src/media/audio/sound/audiofile.cpp @@ -41,7 +41,7 @@ void AudioFile::onBufferFinish() { if (buffer_->sample_rate == 0) { - JAMI_ERR("Error cannot update playback slider, sampling rate is 0"); + JAMI_ERR("Error unable to update playback slider, sampling rate is 0"); return; } @@ -75,7 +75,7 @@ AudioFile::AudioFile(const std::string& fileName, unsigned int sampleRate, AVSam dev.name = fileName; if (decoder->openInput(dev) < 0) - throw AudioFileException("File could not be opened: " + fileName); + throw AudioFileException("Unable to open file: " + fileName); if (decoder->setupAudio() < 0) throw AudioFileException("Decoder setup failed: " + fileName); diff --git a/src/media/localrecorder.cpp b/src/media/localrecorder.cpp index ed92ab65957f75ac965fdc36edfe9133bb99bd36..baa1b3faba9192e9c2f90a5cdfd7ad9bf2be55b5 100644 --- a/src/media/localrecorder.cpp +++ b/src/media/localrecorder.cpp @@ -47,7 +47,7 @@ void LocalRecorder::setPath(const std::string& path) { if (isRecording()) { - JAMI_ERR("can't set path while recording"); + JAMI_ERR("Unable to set path while recording"); return; } @@ -59,17 +59,17 @@ bool LocalRecorder::startRecording() { if (isRecording()) { - JAMI_ERR("recording already started!"); + JAMI_ERR("Recording already started!"); return false; } if (path_.empty()) { - JAMI_ERR("could not start recording (path not set)"); + JAMI_ERR("Unable to start recording (path not set)"); return false; } if (!recorder_) { - JAMI_ERR("could not start recording (no recorder)"); + JAMI_ERR("Unable to start recording (no recorder)"); return false; } diff --git a/src/media/localrecordermanager.cpp b/src/media/localrecordermanager.cpp index 78de894c4e38e6c969356f84ac58050e67c728d4..8340facb2c15b97cac178707577db5ad66da206a 100644 --- a/src/media/localrecordermanager.cpp +++ b/src/media/localrecordermanager.cpp @@ -40,7 +40,7 @@ void LocalRecorderManager::insertRecorder(const std::string& path, std::unique_ptr<LocalRecorder> rec) { if (!rec) { - throw std::invalid_argument("couldn't insert null recorder"); + throw std::invalid_argument("Unable to insert null recorder"); } std::lock_guard lock(recorderMapMutex_); @@ -48,7 +48,7 @@ LocalRecorderManager::insertRecorder(const std::string& path, std::unique_ptr<Lo if (!ret.second) { throw std::invalid_argument( - "couldn't insert recorder (passed path is already used as key)"); + "Unable to insert recorder (passed path is already used as key)"); } } diff --git a/src/media/media_decoder.cpp b/src/media/media_decoder.cpp index ceaa036c6c65a977ddc1f94eee346a0da5df7b8c..dcdc1b9345f11c99d0f891ee54b753eed2df6261 100644 --- a/src/media/media_decoder.cpp +++ b/src/media/media_decoder.cpp @@ -95,7 +95,7 @@ MediaDemuxer::openInput(const DeviceParams& params) auto iformat = av_find_input_format(params.format.c_str()); if (!iformat && !params.format.empty()) - JAMI_WARN("Cannot find format \"%s\"", params.format.c_str()); + JAMI_WARN("Unable to find format \"%s\"", params.format.c_str()); std::string input; @@ -106,7 +106,7 @@ MediaDemuxer::openInput(const DeviceParams& params) // library), its options must all be passed as part of the `input` string. // input = fmt::format("pipewiregrab=draw_mouse=1:fd={}:node={}", params.fd, params.node); - JAMI_LOG("Trying to open input {}", input); + JAMI_LOG("Attempting to open input {}", input); // // In all other cases, we use the `options_` AVDictionary to pass options to FFmpeg. // @@ -170,7 +170,7 @@ MediaDemuxer::openInput(const DeviceParams& params) input = params.input; #endif - JAMI_LOG("Trying to open input {} with format {}, pixel format {}, size {}x{}, rate {}", + JAMI_LOG("Attempting to open input {} with format {}, pixel format {}, size {}x{}, rate {}", input, params.format, params.pixel_format, @@ -222,7 +222,7 @@ MediaDemuxer::findStreamInfo() inputCtx_->max_analyze_duration = 30 * AV_TIME_BASE; int err; if ((err = avformat_find_stream_info(inputCtx_, nullptr)) < 0) { - JAMI_ERR() << "Could not find stream info: " << libav_utils::getError(err); + JAMI_ERR() << "Unable to find stream info: " << libav_utils::getError(err); } streamInfoFound_ = true; } @@ -339,7 +339,7 @@ MediaDemuxer::demuxe() } else if (ret == AVERROR_EOF) { return Status::EndOfFile; } else if (ret < 0) { - JAMI_ERR("Couldn't read frame: %s\n", libav_utils::getError(ret).c_str()); + JAMI_ERR("Unable to read frame: %s\n", libav_utils::getError(ret).c_str()); return Status::ReadError; } @@ -377,7 +377,7 @@ MediaDemuxer::decode() if (inputParams_.format == "x11grab" || inputParams_.format == "dxgigrab") { auto ret = inputCtx_->iformat->read_header(inputCtx_); if (ret == AVERROR_EXTERNAL) { - JAMI_ERR("Couldn't read frame: %s\n", libav_utils::getError(ret).c_str()); + JAMI_ERR("Unable to read frame: %s\n", libav_utils::getError(ret).c_str()); return Status::ReadError; } auto codecpar = inputCtx_->streams[0]->codecpar; @@ -418,7 +418,7 @@ MediaDemuxer::decode() const auto type = media == AVMediaType::AVMEDIA_TYPE_AUDIO ? "AUDIO" : (media == AVMediaType::AVMEDIA_TYPE_VIDEO ? "VIDEO" : "UNSUPPORTED"); - JAMI_ERR("Couldn't read [%s] frame: %s\n", type, libav_utils::getError(ret).c_str()); + JAMI_ERR("Unable to read [%s] frame: %s\n", type, libav_utils::getError(ret).c_str()); return Status::ReadError; } @@ -593,7 +593,7 @@ MediaDecoder::setupStream() ret = avcodec_open2(decoderCtx_, inputDecoder_, nullptr); #endif if (ret < 0) { - JAMI_ERR() << "Could not open codec: " << libav_utils::getError(ret); + JAMI_ERR() << "Unable to open codec: " << libav_utils::getError(ret); return -1; } diff --git a/src/media/media_encoder.cpp b/src/media/media_encoder.cpp index 3acb2ce1f848547ee557ea0506ab24b44d897769..6a71c8e954326c53d52041e5bbb8c76291bbd83e 100644 --- a/src/media/media_encoder.cpp +++ b/src/media/media_encoder.cpp @@ -167,7 +167,7 @@ MediaEncoder::openOutput(const std::string& filename, const std::string& format) format.empty() ? nullptr : format.c_str(), filename.c_str()); if (result < 0) - JAMI_ERR() << "Cannot open " << filename << ": " << libav_utils::getError(-result); + JAMI_ERR() << "Unable to open " << filename << ": " << libav_utils::getError(-result); } int @@ -228,12 +228,12 @@ MediaEncoder::initStream(const SystemCodecInfo& systemCodecInfo, AVBufferRef* fr std::lock_guard lk(encMutex_); if (!outputCtx_) - throw MediaEncoderException("Cannot allocate stream"); + throw MediaEncoderException("Unable to allocate stream"); // Must already have codec instance(s) if (outputCtx_->nb_streams == 0) { - JAMI_ERR("[%p] Can not init, output context has no coding sessions!", this); - throw MediaEncoderException("Can not init, output context has no coding sessions!"); + JAMI_ERR("[%p] Unable to init, output context has no coding sessions!", this); + throw MediaEncoderException("Unable to init, output context has no coding sessions!"); } AVCodecContext* encoderCtx = nullptr; @@ -261,10 +261,10 @@ MediaEncoder::initStream(const SystemCodecInfo& systemCodecInfo, AVBufferRef* fr } if (stream == nullptr) { - JAMI_ERR("[%p] Can not init, output context has no coding sessions for %s", + JAMI_ERR("[%p] Unable to init, output context has no coding sessions for %s", this, systemCodecInfo.name.c_str()); - throw MediaEncoderException("Cannot allocate stream"); + throw MediaEncoderException("Unable to allocate stream"); } currentStreamIdx_ = stream->index; @@ -328,7 +328,7 @@ MediaEncoder::initStream(const SystemCodecInfo& systemCodecInfo, AVBufferRef* fr readConfig(encoderCtx); encoders_.emplace_back(encoderCtx); if (avcodec_open2(encoderCtx, outputCodec_, &options_) < 0) - throw MediaEncoderException("Could not open encoder"); + throw MediaEncoderException("Unable to open encoder"); } avcodec_parameters_from_context(stream->codecpar, encoderCtx); @@ -352,7 +352,7 @@ MediaEncoder::initStream(const SystemCodecInfo& systemCodecInfo, AVBufferRef* fr scaledFrameBufferSize_ = videoFrameSize(format, width, height); if (scaledFrameBufferSize_ < 0) throw MediaEncoderException( - ("Could not compute buffer size: " + libav_utils::getError(scaledFrameBufferSize_)) + ("Unable to compute buffer size: " + libav_utils::getError(scaledFrameBufferSize_)) .c_str()); else if (scaledFrameBufferSize_ <= AV_INPUT_BUFFER_MIN_SIZE) throw MediaEncoderException("buffer too small"); @@ -382,7 +382,7 @@ MediaEncoder::openIOContext() if (!(outputCtx_->oformat->flags & AVFMT_NOFILE)) { fileIO_ = true; if ((ret = avio_open(&outputCtx_->pb, filename, AVIO_FLAG_WRITE)) < 0) { - throw MediaEncoderException(fmt::format("Could not open IO context for '{}': {}", filename, libav_utils::getError(ret))); + throw MediaEncoderException(fmt::format("Unable to open IO context for '{}': {}", filename, libav_utils::getError(ret))); } } } @@ -394,7 +394,7 @@ MediaEncoder::startIO() if (!outputCtx_->pb) openIOContext(); if (avformat_write_header(outputCtx_, options_ ? &options_ : nullptr)) { - JAMI_ERR("Could not write header for output file... check codec parameters"); + JAMI_ERR("Unable to write header for output file... check codec parameters"); throw MediaEncoderException("Failed to write output file header"); } @@ -562,7 +562,7 @@ MediaEncoder::flush() int ret = 0; for (size_t i = 0; i < outputCtx_->nb_streams; ++i) { if (encode(nullptr, i) < 0) { - JAMI_ERR() << "Could not flush stream #" << i; + JAMI_ERR() << "Unable to flush stream #" << i; ret |= 1u << i; // provide a way for caller to know which streams failed } } @@ -879,7 +879,7 @@ MediaEncoder::setBitrate(uint64_t br) // stopEncoder(); // encoderCtx = initCodec(codecType, codecId, br); // if (avcodec_open2(encoderCtx, outputCodec_, &options_) < 0) - // throw MediaEncoderException("Could not open encoder"); + // throw MediaEncoderException("Unable to open encoder"); } initAccel(encoderCtx, br); return 1; // OK diff --git a/src/media/media_filter.cpp b/src/media/media_filter.cpp index d868c07015c6e9a8016464abe2aedba26bcd516c..6f62cb2c81e0f2341650620616b5c24a6555bb3a 100644 --- a/src/media/media_filter.cpp +++ b/src/media/media_filter.cpp @@ -180,7 +180,7 @@ MediaFilter::feedInput(AVFrame* frame, const std::string& inputName) int flags = AV_BUFFERSRC_FLAG_KEEP_REF; if ((ret = av_buffersrc_add_frame_flags(inputs_[i], frame, flags)) < 0) - return fail("Could not pass frame to filters", ret); + return fail("Unable to pass frame to filters", ret); else return 0; } @@ -255,7 +255,7 @@ MediaFilter::initOutputFilter(AVFilterInOut* out) if ((ret = avfilter_link(out->filter_ctx, out->pad_idx, buffersinkCtx, 0)) < 0) { avfilter_free(buffersinkCtx); - return fail("Could not link buffer sink to graph", ret); + return fail("Unable to link buffer sink to graph", ret); } output_ = buffersinkCtx; diff --git a/src/media/media_recorder.cpp b/src/media/media_recorder.cpp index 139ae53d46fb43c798c676701b0553ce1817207e..218c036e916978c3928268c6d3f0e43788089406 100644 --- a/src/media/media_recorder.cpp +++ b/src/media/media_recorder.cpp @@ -280,11 +280,11 @@ MediaRecorder::addStream(const MediaStream& ms) { std::lock_guard lk(mutexStreamSetup_); if (audioOnly_ && ms.isVideo) { - JAMI_ERR() << "Trying to add video stream to audio only recording"; + JAMI_ERR() << "Attempting to add video stream to audio only recording"; return nullptr; } if (ms.format < 0 || ms.name.empty()) { - JAMI_ERR() << "Trying to add invalid stream to recording"; + JAMI_ERR() << "Attempting to add invalid stream to recording"; return nullptr; } @@ -523,7 +523,7 @@ MediaRecorder::setupVideoOutput() int streams = peer.isValid() + local.isValid() + mixer.isValid(); switch (streams) { case 0: { - JAMI_WARN() << "Trying to record a video stream but none is valid"; + JAMI_WARN() << "Attempting to record a video stream but none is valid"; return; } case 1: { @@ -535,7 +535,7 @@ MediaRecorder::setupVideoOutput() else if (mixer.isValid()) inputStream = mixer; else { - JAMI_ERR("Trying to record a stream but none is valid"); + JAMI_ERR("Attempting to record a stream but none is valid"); break; } @@ -634,7 +634,7 @@ MediaRecorder::setupAudioOutput() int ret = -1; if (streams_.empty()) { - JAMI_WARN() << "Trying to record a audio stream but none is valid"; + JAMI_WARN() << "Attempting to record a audio stream but none is valid"; return; } diff --git a/src/media/media_stream.h b/src/media/media_stream.h index dd9eed265492895e4ae28382f0cb5af75132733a..e8d779c4a19dc5fcc8ab80d9ac38cc4d5b61ca5f 100644 --- a/src/media/media_stream.h +++ b/src/media/media_stream.h @@ -119,7 +119,7 @@ struct MediaStream break; } } else { - JAMI_WARN() << "Trying to get stream info from null codec context"; + JAMI_WARN() << "Attempting to get stream info from null codec context"; } } diff --git a/src/media/recordable.cpp b/src/media/recordable.cpp index 124f140b25f950532feedb45d27790e62bbf6c1e..8740aede05186f37777636b74f123a2b04e435c1 100644 --- a/src/media/recordable.cpp +++ b/src/media/recordable.cpp @@ -48,7 +48,7 @@ bool Recordable::toggleRecording() { if (!recorder_) { - JAMI_ERR("couldn't toggle recording, non existent recorder"); + JAMI_ERR("Unable to toggle recording, non existent recorder"); return false; } @@ -69,13 +69,13 @@ Recordable::startRecording(const std::string& path) { std::lock_guard lk {apiMutex_}; if (!recorder_) { - JAMI_ERR("couldn't start recording, non existent recorder"); + JAMI_ERR("Unable to start recording, non existent recorder"); return false; } if (!recording_) { if (path.empty()) { - JAMI_ERR("couldn't start recording, path is empty"); + JAMI_ERR("Unable to start recording, path is empty"); return false; } @@ -93,12 +93,12 @@ Recordable::stopRecording() { std::lock_guard lk {apiMutex_}; if (!recorder_) { - JAMI_WARN("couldn't stop recording, non existent recorder"); + JAMI_WARN("Unable to stop recording, non existent recorder"); return; } if (not recording_) { - JAMI_WARN("couldn't stop non-running recording"); + JAMI_WARN("Unable to stop non-running recording"); return; } diff --git a/src/media/socket_pair.cpp b/src/media/socket_pair.cpp index 0589affd503cababca55a610ed2d7f3bd2b152f8..f90a613056fafbca0b6425b87bacf53dc7c57ac2 100644 --- a/src/media/socket_pair.cpp +++ b/src/media/socket_pair.cpp @@ -101,14 +101,14 @@ public: // XXX: see srtp_open from libavformat/srtpproto.c if (ff_srtp_set_crypto(&srtp_out, out_suite, out_key) < 0) { srtp_close(); - throw std::runtime_error("Could not set crypto on output"); + throw std::runtime_error("Unable to set crypto on output"); } } if (in_suite && in_key) { if (ff_srtp_set_crypto(&srtp_in, in_suite, in_key) < 0) { srtp_close(); - throw std::runtime_error("Could not set crypto on input"); + throw std::runtime_error("Unable to set crypto on input"); } } } @@ -525,7 +525,7 @@ SocketPair::readCallback(uint8_t* buf, int buf_size) else if (header->pt == 200) { // not used yet } else { - JAMI_DBG("Can't read RTCP: unknown packet type %u", header->pt); + JAMI_DBG("Unable to read RTCP: unknown packet type %u", header->pt); } fromRTCP = true; } diff --git a/src/media/system_codec_container.cpp b/src/media/system_codec_container.cpp index de4c260d6449f95e08be5bebb153cbb389452df5..97f6cb8abc223939d924f3bedfc428350e9848e4 100644 --- a/src/media/system_codec_container.cpp +++ b/src/media/system_codec_container.cpp @@ -218,7 +218,7 @@ SystemCodecContainer::setActiveH265() JAMI_WARN("Found a usable accelerated H265/HEVC codec: %s, enabling.", apiName.c_str()); return true; } else { - JAMI_ERR("Can't find a usable accelerated H265/HEVC codec, disabling."); + JAMI_ERR("Unable to find a usable accelerated H265/HEVC codec, disabling."); removeCodecByName("H265"); } return false; diff --git a/src/media/video/accel.cpp b/src/media/video/accel.cpp index 802042d6ea1f8c24830eaf66d7c5488c8242028d..cd4507abaff181d68ea45a886ffdb4b73e2ee3c8 100644 --- a/src/media/video/accel.cpp +++ b/src/media/video/accel.cpp @@ -290,7 +290,7 @@ HardwareAccel::transfer(const VideoFrame& frame) } if (!hwFrame->hw_frames_ctx) { - JAMI_ERR() << "Failed to allocate hardware buffer: Cannot allocate memory"; + JAMI_ERR() << "Failed to allocate hardware buffer: Unable to allocate memory"; return nullptr; } @@ -325,7 +325,7 @@ HardwareAccel::initFrame() { int ret = 0; if (!deviceCtx_) { - JAMI_ERR() << "Cannot initialize hardware frames without a valid hardware device"; + JAMI_ERR() << "Unable to initialize hardware frames without a valid hardware device"; return false; } @@ -377,11 +377,11 @@ HardwareAccel::transferToMainMemory(const VideoFrame& frame, AVPixelFormat desir { auto input = frame.pointer(); if (not input) - throw std::runtime_error("Cannot transfer null frame"); + throw std::runtime_error("Unable to transfer null frame"); auto desc = av_pix_fmt_desc_get(static_cast<AVPixelFormat>(input->format)); if (!desc) { - throw std::runtime_error("Cannot transfer frame with invalid format"); + throw std::runtime_error("Unable to transfer frame with invalid format"); } auto out = std::make_unique<VideoFrame>(); @@ -395,7 +395,7 @@ HardwareAccel::transferToMainMemory(const VideoFrame& frame, AVPixelFormat desir int ret = av_hwframe_transfer_data(output, input, 0); if (ret < 0) { - throw std::runtime_error("Cannot transfer the frame from GPU"); + throw std::runtime_error("Unable to transfer the frame from GPU"); } output->pts = input->pts; diff --git a/src/media/video/androidvideo/video_device_impl.cpp b/src/media/video/androidvideo/video_device_impl.cpp index ac09dbfc0ce8539eff819b65c520d799512f6c8e..9c36bb5dc2ec51dfaf80959566f159d49260994b 100644 --- a/src/media/video/androidvideo/video_device_impl.cpp +++ b/src/media/video/androidvideo/video_device_impl.cpp @@ -108,7 +108,7 @@ VideoDeviceImpl::selectFormat() JAMI_DBG("AndroidVideo: picked format %s", fmt_->name.c_str()); } else { fmt_ = &and_formats[0]; - JAMI_ERR("AndroidVideo: Could not find a known format to use"); + JAMI_ERR("AndroidVideo: Unable to find a known format to use"); } } diff --git a/src/media/video/iosvideo/video_device_impl.cpp b/src/media/video/iosvideo/video_device_impl.cpp index e71c3510559158a0e1c67cb87e818b431ec1c7ce..785c877e1b1c546e6e223b0cb8f2b599f10c1788 100644 --- a/src/media/video/iosvideo/video_device_impl.cpp +++ b/src/media/video/iosvideo/video_device_impl.cpp @@ -96,7 +96,7 @@ VideoDeviceImpl::selectFormat() JAMI_DBG("Video: picked format %s", fmt_->name.c_str()); } else { fmt_ = &ios_formats[0]; - JAMI_ERR("Video: Could not find a known format to use"); + JAMI_ERR("Video: Unable to find a known format to use"); } } diff --git a/src/media/video/sinkclient.cpp b/src/media/video/sinkclient.cpp index c94237b05677d4835d937196ca2c122deadf48ed..642b5eeb2fee954cd29b07eb1b7bcb1a1cd30fa0 100644 --- a/src/media/video/sinkclient.cpp +++ b/src/media/video/sinkclient.cpp @@ -239,7 +239,7 @@ ShmHolder::renderFrame(const VideoFrame& src) noexcept const auto frameSize = videoFrameSize(format, width, height); if (!resizeArea(frameSize)) { - JAMI_ERR("[ShmHolder:%s] Could not resize area size: %dx%d, format: %d", + JAMI_ERR("[ShmHolder:%s] Unable to resize area size: %dx%d, format: %d", openedName_.c_str(), width, height, diff --git a/src/media/video/v4l2/video_device_impl.cpp b/src/media/video/v4l2/video_device_impl.cpp index 4f34f0186d2c1090f8329b16eb9f199ab0209c5b..8d0ca82858e926fb8bd9f6f9d07d91f7e747ef77 100644 --- a/src/media/video/v4l2/video_device_impl.cpp +++ b/src/media/video/v4l2/video_device_impl.cpp @@ -267,7 +267,7 @@ VideoV4l2Size::readFrameRates(int fd, unsigned int pixel_format) if (ioctl(fd, VIDIOC_ENUM_FRAMEINTERVALS, &frmival)) { addRate(fallback_rate); - JAMI_ERR("could not query frame interval for size"); + JAMI_ERR("Unable to query frame interval for size"); return; } @@ -343,7 +343,7 @@ VideoV4l2Channel::readSizes(int fd, unsigned int pixelformat) fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; if (ioctl(fd, VIDIOC_G_FMT, &fmt) < 0) - throw std::runtime_error("Could not get format"); + throw std::runtime_error("Unable to get format"); VideoV4l2Size size(fmt.fmt.pix.width, fmt.fmt.pix.height); size.readFrameRates(fd, fmt.fmt.pix.pixelformat); @@ -415,7 +415,7 @@ VideoV4l2Channel::readFormats(int fd) } if (fmt_index == 0) - throw std::runtime_error("Could not enumerate formats"); + throw std::runtime_error("Unable to enumerate formats"); putCIFFirst(); } @@ -448,17 +448,17 @@ VideoDeviceImpl::VideoDeviceImpl(const string& id, const std::string& path) } int fd = open(path.c_str(), O_RDWR); if (fd == -1) - throw std::runtime_error("could not open device"); + throw std::runtime_error("Unable to open device"); v4l2_capability cap; if (ioctl(fd, VIDIOC_QUERYCAP, &cap)) - throw std::runtime_error("could not query capabilities"); + throw std::runtime_error("Unable to query capabilities"); if (!(cap.capabilities & V4L2_CAP_VIDEO_CAPTURE)) - throw std::runtime_error("not a capture device"); + throw std::runtime_error("Not a capture device"); if (cap.capabilities & V4L2_CAP_TOUCH) - throw std::runtime_error("touch device, ignoring it"); + throw std::runtime_error("Touch device, ignoring it"); name = string(reinterpret_cast<const char*>(cap.card)); diff --git a/src/media/video/video_base.cpp b/src/media/video/video_base.cpp index d18ca6277ca90bbaa775a1cf75ec5b5ea7be8c06..e9b4f2b3e4ead500f83fcab13e29527b4ed88f11 100644 --- a/src/media/video/video_base.cpp +++ b/src/media/video/video_base.cpp @@ -128,7 +128,7 @@ bool convert<jami::video::VideoSettings>::decode(const Node& node, jami::video::VideoSettings& rhs) { if (not node.IsMap()) { - JAMI_WARN("Can't decode VideoSettings YAML node"); + JAMI_WARN("Unable to decode VideoSettings YAML node"); return false; } rhs.name = node["name"].as<std::string>(); diff --git a/src/media/video/video_device.h b/src/media/video/video_device.h index 81b5a1098ac4b14a57683686a46829d052c1347d..7cd77b044cab0a66bcf0b52a61f7280ad951719f 100644 --- a/src/media/video/video_device.h +++ b/src/media/video/video_device.h @@ -211,7 +211,7 @@ private: try { rate_val = rate.empty() ? 0 : jami::stod(rate); } catch (...) { - JAMI_WARN("Can't read framerate \"%s\"", rate.c_str()); + JAMI_WARN("Unable to read framerate \"%s\"", rate.c_str()); } // fallback to framerate closest to 30 FPS if (rate_val == 0) diff --git a/src/media/video/video_device_monitor.cpp b/src/media/video/video_device_monitor.cpp index 9326239275ca1cac8cb68f2c8c58a9c24b2ec03d..94ab31afe61f706bba19307f9c4fbd537c8cc829 100644 --- a/src/media/video/video_device_monitor.cpp +++ b/src/media/video/video_device_monitor.cpp @@ -150,7 +150,7 @@ VideoDeviceMonitor::setDeviceOrientation(const std::string& id, int angle) if (itd != devices_.cend()) { itd->setOrientation(angle); } else { - JAMI_WARN("Can't find device %s to set orientation %d", id.c_str(), angle); + JAMI_WARN("Unable to find device %s to set orientation %d", id.c_str(), angle); } } diff --git a/src/media/video/video_input.cpp b/src/media/video/video_input.cpp index 94015e74fef7a3e787ce11c444cb1f350bf62ff3..212f5761b6d5d1de8880acf6929a564210fcc6fe 100644 --- a/src/media/video/video_input.cpp +++ b/src/media/video/video_input.cpp @@ -265,7 +265,7 @@ VideoInput::configureFilePlayback(const std::string&, if (fmt != AV_PIX_FMT_NONE) { decOpts_.pixel_format = av_get_pix_fmt_name(fmt); } else { - JAMI_WARN("Could not determine pixel format, using default"); + JAMI_WARN("Unable to determine pixel format, using default"); decOpts_.pixel_format = av_get_pix_fmt_name(AV_PIX_FMT_YUV420P); } @@ -319,7 +319,7 @@ VideoInput::createDecoder() int ret = decoder->openInput(decOpts_); ready = ret >= 0; if (ret < 0 && -ret != EBUSY) { - JAMI_ERR("Could not open input \"%s\" with status %i", decOpts_.input.c_str(), ret); + JAMI_ERR("Unable to open input \"%s\" with status %i", decOpts_.input.c_str(), ret); foundDecOpts(decOpts_); return; } else if (-ret == EBUSY) { @@ -358,7 +358,7 @@ VideoInput::createDecoder() if (fmt != AV_PIX_FMT_NONE) { decOpts_.pixel_format = av_get_pix_fmt_name(fmt); } else { - JAMI_WARN("Could not determine pixel format, using default"); + JAMI_WARN("Unable to determine pixel format, using default"); decOpts_.pixel_format = av_get_pix_fmt_name(AV_PIX_FMT_YUV420P); } @@ -461,20 +461,20 @@ VideoInput::initLinuxGrab(const std::string& display) int fd = std::stoi(display.substr(fdPos)); if (pid != getpid()) { #ifdef SYS_pidfd_getfd - // We can't directly use a file descriptor that was opened in a different + // We are unable to directly use a file descriptor that was opened in a different // process, so we try to duplicate it in the current process. int pidfd = syscall(SYS_pidfd_open, pid, 0); if (pidfd < 0) { - JAMI_ERROR("Can't duplicate PipeWire fd: call to pidfd_open failed (errno = {})", errno); + JAMI_ERROR("Unable to duplicate PipeWire fd: call to pidfd_open failed (errno = {})", errno); return false; } fd = syscall(SYS_pidfd_getfd, pidfd, fd, 0); if (fd < 0) { - JAMI_ERROR("Can't duplicate PipeWire fd: call to pidfd_getfd failed (errno = {})", errno); + JAMI_ERROR("Unable to duplicate PipeWire fd: call to pidfd_getfd failed (errno = {})", errno); return false; } #else - JAMI_ERROR("Can't duplicate PipeWire fd: pidfd_getfd syscall not available"); + JAMI_ERROR("Unable to duplicate PipeWire fd: pidfd_getfd syscall not available"); return false; #endif } @@ -601,8 +601,8 @@ VideoInput::initFile(std::string path) } // check if file has video, fall back to default device if none - // FIXME the way this is done is hackish, but it can't be done in createDecoder because that - // would break the promise returned in switchInput + // FIXME the way this is done is hackish, but it is unable to be done in createDecoder + // because that would break the promise returned in switchInput DeviceParams p; p.input = path; p.name = path; diff --git a/src/media/video/video_mixer.cpp b/src/media/video/video_mixer.cpp index 10c400cb174db6ace9b3ffce868a5fb67fabbe1a..bf84653915bdb32b6449ae07283fa24822758664 100644 --- a/src/media/video/video_mixer.cpp +++ b/src/media/video/video_mixer.cpp @@ -67,7 +67,7 @@ struct VideoMixer::VideoMixerSource return render_frame; } - // Current render informations + // Current render information int x {}; int y {}; int w {}; diff --git a/src/media/video/video_receive_thread.cpp b/src/media/video/video_receive_thread.cpp index f2bfcfdcc16e9ce3b897166612433cfc5d6575ad..c820bcc18d46c52fdedfa28185e680a154c56e45 100644 --- a/src/media/video/video_receive_thread.cpp +++ b/src/media/video/video_receive_thread.cpp @@ -144,7 +144,7 @@ VideoReceiveThread::setup() } if (videoDecoder_->openInput(args_)) { - JAMI_ERR("Could not open input \"%s\"", args_.input.c_str()); + JAMI_ERR("Unable to open input \"%s\"", args_.input.c_str()); return false; } @@ -241,7 +241,7 @@ VideoReceiveThread::configureVideoOutput() JAMI_DBG("[%p] Configuring video output", this); if (not loop_.isRunning()) { - JAMI_WARN("[%p] Can not configure video output, the loop is not running!", this); + JAMI_WARN("[%p] Unable to configure video output, the loop is not running!", this); return false; } diff --git a/src/media/video/video_rtp_session.cpp b/src/media/video/video_rtp_session.cpp index 804be9167177a00943e4c1d3eb9cf6c17a758133..643c9080ca8c7d0f5f253e681e24edb5e388514b 100644 --- a/src/media/video/video_rtp_session.cpp +++ b/src/media/video/video_rtp_session.cpp @@ -161,7 +161,7 @@ VideoRtpSession::startSender() return; } } else { - JAMI_WARN("Can't lock video input"); + JAMI_WARN("Unable to lock video input"); return; } diff --git a/src/media/video/winvideo/video_device_impl.cpp b/src/media/video/winvideo/video_device_impl.cpp index 0e6beb5f8b37f9826eddd50aa0f6c01274978260..e960f783a8207c5b800d47b282402d3a14b63296 100644 --- a/src/media/video/winvideo/video_device_impl.cpp +++ b/src/media/video/winvideo/video_device_impl.cpp @@ -101,7 +101,7 @@ VideoDeviceImpl::setup() IID_ICaptureGraphBuilder2, (void**) &cInterface->captureGraph_); if (FAILED(hr)) - return fail("Could not create the Filter Graph Manager"); + return fail("Unable to create the Filter Graph Manager"); hr = CoCreateInstance(CLSID_FilterGraph, nullptr, @@ -109,11 +109,11 @@ VideoDeviceImpl::setup() IID_IGraphBuilder, (void**) &cInterface->graph_); if (FAILED(hr)) - return fail("Could not add the graph builder!"); + return fail("Unable to add the graph builder!"); hr = cInterface->captureGraph_->SetFiltergraph(cInterface->graph_); if (FAILED(hr)) - return fail("Could not set filtergraph."); + return fail("Unable to set filtergraph."); ICreateDevEnum* pDevEnum; hr = CoCreateInstance(CLSID_SystemDeviceEnum, @@ -195,7 +195,7 @@ VideoDeviceImpl::setup() if (SUCCEEDED(hr)) hr = cInterface->graph_->AddFilter(cInterface->videoInputFilter_, var.bstrVal); else { - fail("Could not add filter to video device."); + fail("Unable to add filter to video device."); } hr = cInterface->captureGraph_->FindInterface(&PIN_CATEGORY_PREVIEW, &MEDIATYPE_Video, @@ -209,7 +209,7 @@ VideoDeviceImpl::setup() IID_IAMStreamConfig, (void**) &cInterface->streamConf_); if (FAILED(hr)) { - fail("Couldn't config the stream!"); + fail("Unable to config the stream!"); } } @@ -222,7 +222,7 @@ VideoDeviceImpl::setup() pMoniker->Release(); if (FAILED(hr) || cInterface->streamConf_ == NULL) { - fail("Could not find the video device."); + fail("Unable to find the video device."); } int piCount; @@ -314,7 +314,7 @@ VideoDeviceImpl::setDeviceParams(const DeviceParams& params) ((VIDEOINFOHEADER*) pmt->pbFormat)->AvgTimePerFrame = (FrameRate(1e7) / params.framerate).real(); if (FAILED(cInterface->streamConf_->SetFormat(pmt))) { - JAMI_ERR("Could not set settings."); + JAMI_ERR("Unable to set settings."); } } } diff --git a/src/media/video/winvideo/video_device_monitor_impl.cpp b/src/media/video/winvideo/video_device_monitor_impl.cpp index 81a35c243d472e1923f9461a73327db3742d2cec..84938f8b2664b45b92e4a33f05d8b5ecf01a6bfe 100644 --- a/src/media/video/winvideo/video_device_monitor_impl.cpp +++ b/src/media/video/winvideo/video_device_monitor_impl.cpp @@ -239,7 +239,7 @@ VideoDeviceMonitorImpl::enumerateVideoInputDevices() IID_PPV_ARGS(&pDevEnum)); if (FAILED(hr)) { - JAMI_ERR() << "Can't enumerate webcams"; + JAMI_ERR() << "Unable to enumerate webcams"; return {}; } diff --git a/src/plugin/callservicesmanager.cpp b/src/plugin/callservicesmanager.cpp index 415c057963807939813d583419e41b63d9de1662..0d98a08a47d737255f448e70ccb83b6e60935d00 100644 --- a/src/plugin/callservicesmanager.cpp +++ b/src/plugin/callservicesmanager.cpp @@ -128,7 +128,7 @@ CallServicesManager::registerComponentsLifeCycleManagers(PluginManager& pluginMa == (uintptr_t) handlerIt->get() && handlerIdPair.second; }); - // If MediaHandler we're trying to destroy is currently in use, we deactivate it. + // If MediaHandler is attempting to destroy one which is currently in use, we deactivate it. if (handlerId != toggledList.second.end()) toggleCallMediaHandler((*handlerId).first, toggledList.first, false); } diff --git a/src/plugin/chatservicesmanager.cpp b/src/plugin/chatservicesmanager.cpp index 8c64610e4eabecd9bb93130d0d12122035a3faf7..5ae7009f23de80f0b3636083fb856b5d27014dc5 100644 --- a/src/plugin/chatservicesmanager.cpp +++ b/src/plugin/chatservicesmanager.cpp @@ -68,7 +68,7 @@ ChatServicesManager::registerComponentsLifeCycleManagers(PluginManager& pluginMa uintptr_t handlerId) { return (handlerId == id); }); - // If ChatHandler we're trying to destroy is currently in use, we deactivate it. + // If ChatHandler is attempting to destroy one which is currently in use, we deactivate it. if (handlerId != toggledList.second.end()) { (*handlerIt)->detach(chatSubjects_[toggledList.first]); toggledList.second.erase(handlerId); diff --git a/src/plugin/jamipluginmanager.cpp b/src/plugin/jamipluginmanager.cpp index d73a95cb9d44939a8e880a47ab7d3e11bc22987d..d624018c6481352253da323bf6afa7da63adfcc9 100644 --- a/src/plugin/jamipluginmanager.cpp +++ b/src/plugin/jamipluginmanager.cpp @@ -69,7 +69,7 @@ JamiPluginManager::getPluginAuthor(const std::string& rootPath, const std::strin { auto cert = PluginUtils::readPluginCertificate(rootPath, pluginId); if (!cert) { - JAMI_ERROR("Could not read plugin certificate"); + JAMI_ERROR("Unable to read plugin certificate"); return {}; } return cert->getIssuerName(); @@ -325,7 +325,7 @@ JamiPluginManager::uninstallPlugin(const std::string& rootPath) JAMI_INFO() << "PLUGIN: unloading before uninstall."; bool status = libjami::unloadPlugin(rootPath); if (!status) { - JAMI_INFO() << "PLUGIN: could not unload, not performing uninstall."; + JAMI_INFO() << "PLUGIN: unable to unload, not performing uninstall."; return FAILURE; } } diff --git a/src/plugin/pluginmanager.cpp b/src/plugin/pluginmanager.cpp index 655dd9f7a4c521ace3bbc8f6751e9c4dcd779906..d364656618077aeef327cd017ede5569c7b91cb7 100644 --- a/src/plugin/pluginmanager.cpp +++ b/src/plugin/pluginmanager.cpp @@ -151,7 +151,7 @@ PluginManager::callPluginInitFunction(const std::string& path) if (!exitFunc) { JAMI_ERR() << "Plugin: init failed"; - // emit signal with error message to let user know that jamid could not load plugin + // emit signal with error message to let user know that jamid was unable to load plugin returnValue = false; } else { returnValue = true; diff --git a/src/plugin/pluginsutils.cpp b/src/plugin/pluginsutils.cpp index 8cf9142aed52f7530c6abfa4e35639ab62fc749d..8546762f6ade9fef62cbb643e0453a8f1b86d81d 100644 --- a/src/plugin/pluginsutils.cpp +++ b/src/plugin/pluginsutils.cpp @@ -290,7 +290,7 @@ getLanguage() if (auto envLang = std::getenv("JAMI_LANG")) lang = envLang; else - JAMI_INFO() << "Error getting JAMI_LANG env, trying to get system language"; + JAMI_INFO() << "Error getting JAMI_LANG env, attempting to get system language"; // If language preference is empty, try to get from the system. if (lang.empty()) { #ifdef WIN32 @@ -309,11 +309,11 @@ getLanguage() lang.append(utf8Buffer); string_replace(lang, "-", "_"); } - // Even though we default to the system variable in windows, technically this + // Even though we default to the system variable in Windows, technically this // part of the code should not be reached because the client-qt must define that - // variable and we cannot run the client and the daemon in diferent processes in Windows. + // variable and is unable to run the client and the daemon in diferent processes in Windows. #else - // The same way described in the comment just above, the android should not reach this + // The same way described in the comment just above, Android should not reach this // part of the code given the client-android must define "JAMI_LANG" system variable. // And even if this part is reached, it should not work since std::locale is not // supported by the NDK. diff --git a/src/plugin/webviewservicesmanager.cpp b/src/plugin/webviewservicesmanager.cpp index ad956ec7b246ddd555a8c81d8a660bd76e2abb75..3e8ded0a61f3a72b7ed65fc7e7422cc017b4a61e 100644 --- a/src/plugin/webviewservicesmanager.cpp +++ b/src/plugin/webviewservicesmanager.cpp @@ -64,7 +64,7 @@ WebViewServicesManager::registerComponentsLifeCycleManagers(PluginManager& plugi // make sure pointer is valid if (!ptr) { - JAMI_ERR("trying to register a webview handler with invalid pointer!"); + JAMI_ERR("Attempting to register a webview handler with invalid pointer!"); return -1; } @@ -85,7 +85,7 @@ WebViewServicesManager::registerComponentsLifeCycleManagers(PluginManager& plugi // make sure pointer is valid if (!ptr) { - JAMI_ERR("trying to unregister a webview handler with invalid pointer!"); + JAMI_ERR("Attempting to unregister a webview handler with invalid pointer!"); return false; } diff --git a/src/preferences.cpp b/src/preferences.cpp index 2533dce4c58730ac814e203c38430a1180d8e9b1..b3d4252346e9cebc33ec415bdaa69cff43a1a23a 100644 --- a/src/preferences.cpp +++ b/src/preferences.cpp @@ -334,7 +334,7 @@ AudioPreference::createAudioLayer() try { return new PulseLayer(*this); } catch (const std::runtime_error& e) { - JAMI_WARN("Could not create pulseaudio layer, falling back to ALSA"); + JAMI_WARN("Unable to create pulseaudio layer, falling back to ALSA"); } } @@ -355,7 +355,7 @@ AudioPreference::createAudioLayer() try { return new CoreLayer(*this); } catch (const std::runtime_error& e) { - JAMI_WARN("Could not create coreaudio layer. There will be no sound."); + JAMI_WARN("Unable to create coreaudio layer. There will be no sound."); } return NULL; #endif @@ -365,7 +365,7 @@ AudioPreference::createAudioLayer() try { return new PortAudioLayer(*this); } catch (const std::runtime_error& e) { - JAMI_WARN("Could not create PortAudio layer. There will be no sound."); + JAMI_WARN("Unable to create PortAudio layer. There will be no sound."); } return nullptr; #endif @@ -456,7 +456,7 @@ AudioPreference::setRecordPath(const std::string& r) recordpath_ = path; return true; } else { - JAMI_ERR("%s is not writable, cannot be the recording path", path.c_str()); + JAMI_ERR("%s is not writable, unable to be the recording path", path.c_str()); return false; } } diff --git a/src/scheduled_executor.h b/src/scheduled_executor.h index 1de42cb279063e953b9dba950b1032323dcfa7ae..be205f55a2efeacac8314909dc4bafcbd4f1d5a7 100644 --- a/src/scheduled_executor.h +++ b/src/scheduled_executor.h @@ -218,7 +218,7 @@ public: uint32_t linum=CURRENT_LINE()); /** - * Stop the scheduler, can't be reversed + * Stop the scheduler, it is unable to be reversed */ void stop(); diff --git a/src/sip/pres_sub_client.cpp b/src/sip/pres_sub_client.cpp index 2562445595725b672025c5817e7970ce31aed191..8fa52046c7e13ace11f620b9decfb4385160c497 100644 --- a/src/sip/pres_sub_client.cpp +++ b/src/sip/pres_sub_client.cpp @@ -189,7 +189,7 @@ PresSubClient::pres_client_evsub_on_state(pjsip_evsub* sub, pjsip_event* event) * subscribe. */ /* giveup: The subscription has been terminated because - * the notifier could not obtain authorization in a + * the notifier was unable to obtain authorization in a * timely fashion. If a "retry-after" parameter is * also present, the client SHOULD wait at least the * number of seconds specified by that parameter before @@ -254,7 +254,7 @@ PresSubClient::pres_client_evsub_on_tsx_state(pjsip_evsub* sub, /* No need to pres->lock() here since the client has a locked dialog*/ if (!pres_client) { - JAMI_WARN("Couldn't find pres_client."); + JAMI_WARN("Unable to find pres_client."); return; } @@ -304,7 +304,7 @@ PresSubClient::pres_client_evsub_on_rx_notify(pjsip_evsub* sub, PresSubClient* pres_client = (PresSubClient*) pjsip_evsub_get_mod_data(sub, modId_); if (!pres_client) { - JAMI_WARN("Couldn't find pres_client from ev_sub."); + JAMI_WARN("Unable to find pres_client from ev_sub."); return; } /* No need to pres->lock() here since the client has a locked dialog*/ @@ -313,7 +313,7 @@ PresSubClient::pres_client_evsub_on_rx_notify(pjsip_evsub* sub, pres_client->reportPresence(); /* The default is to send 200 response to NOTIFY. - * Just leave it there.. + * Just leave it there. */ PJ_UNUSED_ARG(rdata); PJ_UNUSED_ARG(p_st_code); @@ -570,7 +570,7 @@ PresSubClient::subscribe() acc->getCredentialCount(), acc->getCredInfo()) != PJ_SUCCESS) { - JAMI_ERR("Could not initialize credentials for subscribe session authentication"); + JAMI_ERR("Unable to initialize credentials for subscribe session authentication"); } /* Increment the dialog's lock otherwise when presence session creation @@ -600,7 +600,7 @@ PresSubClient::subscribe() acc->getCredentialCount(), acc->getCredInfo()) != PJ_SUCCESS) { - JAMI_ERR("Could not initialize credentials for invite session authentication"); + JAMI_ERR("Unable to initialize credentials for invite session authentication"); return false; } diff --git a/src/sip/pres_sub_server.cpp b/src/sip/pres_sub_server.cpp index af35cc853c5a382b8aaa2af24580b73a3d107ffe..49a17db2aa70fb006c6ac5430cd99be6b86fca12 100644 --- a/src/sip/pres_sub_server.cpp +++ b/src/sip/pres_sub_server.cpp @@ -52,7 +52,7 @@ PresSubServer::pres_evsub_on_srv_state(UNUSED pjsip_evsub* sub, UNUSED pjsip_eve auto account = Manager::instance().getIP2IPAccount(); auto sipaccount = static_cast<SIPAccount *>(account.get()); if (!sipaccount) { - JAMI_ERR("Could not find account IP2IP"); + JAMI_ERR("Unable to find account IP2IP"); return; } @@ -125,7 +125,7 @@ PresSubServer::pres_on_rx_subscribe_request(pjsip_rx_data* rdata) auto account = Manager::instance().getIP2IPAccount(); auto sipaccount = static_cast<SIPAccount *>(account.get()); if (!sipaccount) { - JAMI_ERR("Could not find account IP2IP"); + JAMI_ERR("Unable to find account IP2IP"); return PJ_FALSE; } diff --git a/src/sip/sdp.cpp b/src/sip/sdp.cpp index 5b726aec18103b9b35a658222c93949401d586d8..8d4e5b3b36c152ceeea3170fdc069422452e954f 100644 --- a/src/sip/sdp.cpp +++ b/src/sip/sdp.cpp @@ -360,7 +360,7 @@ Sdp::addMediaDescription(const MediaAttribute& mediaAttr) if (secure) { if (pjmedia_sdp_media_add_attr(med, generateSdesAttribute()) != PJ_SUCCESS) - throw SdpException("Could not add sdes attribute to media"); + throw SdpException("Unable to add sdes attribute to media"); } return med; @@ -389,7 +389,7 @@ Sdp::setPublishedIP(const std::string& addr, pj_uint16_t addr_type) localSession_->origin.addr = sip_utils::CONST_PJ_STR(publishedIpAddr_); localSession_->conn->addr = localSession_->origin.addr; if (pjmedia_sdp_validate(localSession_) != PJ_SUCCESS) - JAMI_ERR("Could not validate SDP"); + JAMI_ERR("Unable to validate SDP"); } } @@ -478,7 +478,7 @@ Sdp::printSession(const pjmedia_sdp_session* session, const char* header, SdpDir auto cloned_session = pjmedia_sdp_session_clone(tmpPool_.get(), session); if (!cloned_session) { - JAMI_ERR("Could not clone SDP for printing"); + JAMI_ERR("Unable to clone SDP for printing"); return; } @@ -640,7 +640,7 @@ Sdp::startNegotiation() JAMI_DBG("Starting media negotiation for [%s]", sessionName_.c_str()); if (negotiator_ == NULL) { - JAMI_ERR("Can't start negotiation with invalid negotiator"); + JAMI_ERR("Unable to start negotiation with invalid negotiator"); return false; } @@ -658,7 +658,7 @@ Sdp::startNegotiation() } if (pjmedia_sdp_neg_get_active_local(negotiator_, &active_local) != PJ_SUCCESS) - JAMI_ERR("Could not retrieve local active session"); + JAMI_ERR("Unable to retrieve local active session"); setActiveLocalSdpSession(active_local); @@ -668,7 +668,7 @@ Sdp::startNegotiation() if (pjmedia_sdp_neg_get_active_remote(negotiator_, &active_remote) != PJ_SUCCESS or active_remote == nullptr) { - JAMI_ERR("Could not retrieve remote active session"); + JAMI_ERR("Unable to retrieve remote active session"); return false; } @@ -692,7 +692,7 @@ Sdp::getFilteredSdp(const pjmedia_sdp_session* session, unsigned media_keep, uns pj_pool_release); auto cloned = pjmedia_sdp_session_clone(tmpPool_.get(), session); if (!cloned) { - JAMI_ERR("Could not clone SDP"); + JAMI_ERR("Unable to clone SDP"); return ""; } @@ -701,7 +701,7 @@ Sdp::getFilteredSdp(const pjmedia_sdp_session* session, unsigned media_keep, uns for (unsigned i = 0; i < cloned->media_count; i++) if (i != media_keep) { if (pjmedia_sdp_media_deactivate(tmpPool_.get(), cloned->media[i]) != PJ_SUCCESS) - JAMI_ERR("Could not deactivate media"); + JAMI_ERR("Unable to deactivate media"); } else { hasKeep = true; } @@ -788,7 +788,7 @@ Sdp::getMediaDescriptions(const pjmedia_sdp_session* session, bool remote) const // get connection info pjmedia_sdp_conn* conn = media->conn ? media->conn : session->conn; if (not conn) { - JAMI_ERR("Could not find connection information for media"); + JAMI_ERR("Unable to find connection information for media"); continue; } descr.addr = std::string_view(conn->addr.ptr, conn->addr.slen); @@ -826,14 +826,14 @@ Sdp::getMediaDescriptions(const pjmedia_sdp_session* session, bool remote) const &STR_RTPMAP, &media->desc.fmt[j]); if (!rtpMapAttribute) { - JAMI_ERR("Could not find rtpmap attribute"); + JAMI_ERR("Unable to find rtpmap attribute"); descr.enabled = false; continue; } pjmedia_sdp_rtpmap rtpmap; if (pjmedia_sdp_attr_get_rtpmap(rtpMapAttribute, &rtpmap) != PJ_SUCCESS || rtpmap.enc_name.slen == 0) { - JAMI_ERR("Could not find payload type %.*s in SDP", + JAMI_ERR("Unable to find payload type %.*s in SDP", (int) media->desc.fmt[j].slen, media->desc.fmt[j].ptr); descr.enabled = false; @@ -843,7 +843,7 @@ Sdp::getMediaDescriptions(const pjmedia_sdp_session* session, bool remote) const descr.rtp_clockrate = rtpmap.clock_rate; descr.codec = findCodecBySpec(codec_raw, rtpmap.clock_rate); if (not descr.codec) { - JAMI_ERR("Could not find codec %.*s", (int) codec_raw.size(), codec_raw.data()); + JAMI_ERR("Unable to find codec %.*s", (int) codec_raw.size(), codec_raw.data()); descr.enabled = false; continue; } @@ -895,7 +895,7 @@ void Sdp::addIceCandidates(unsigned media_index, const std::vector<std::string>& cands) { if (media_index >= localSession_->media_count) { - JAMI_ERR("addIceCandidates failed: cannot access media#%u (may be deactivated)", + JAMI_ERR("addIceCandidates failed: unable to access media#%u (may be deactivated)", media_index); return; } @@ -907,7 +907,7 @@ Sdp::addIceCandidates(unsigned media_index, const std::vector<std::string>& cand pjmedia_sdp_attr* attr = pjmedia_sdp_attr_create(memPool_.get(), "candidate", &val); if (pjmedia_sdp_media_add_attr(media, attr) != PJ_SUCCESS) - throw SdpException("Could not add ICE candidates attribute to media"); + throw SdpException("Unable to add ICE candidates attribute to media"); } } @@ -925,7 +925,7 @@ Sdp::getIceCandidates(unsigned media_index) const return {}; } if (media_index >= remoteSession->media_count || media_index >= localSession->media_count) { - JAMI_ERR("getIceCandidates failed: cannot access media#%u (may be deactivated)", + JAMI_ERR("getIceCandidates failed: unable to access media#%u (may be deactivated)", media_index); return {}; } @@ -957,13 +957,13 @@ Sdp::addIceAttributes(const dhtnet::IceTransport::Attribute&& ice_attrs) pjmedia_sdp_attr* attr = pjmedia_sdp_attr_create(memPool_.get(), "ice-ufrag", &value); if (pjmedia_sdp_attr_add(&localSession_->attr_count, localSession_->attr, attr) != PJ_SUCCESS) - throw SdpException("Could not add ICE.ufrag attribute to local SDP"); + throw SdpException("Unable to add ICE.ufrag attribute to local SDP"); value = sip_utils::CONST_PJ_STR(ice_attrs.pwd); attr = pjmedia_sdp_attr_create(memPool_.get(), "ice-pwd", &value); if (pjmedia_sdp_attr_add(&localSession_->attr_count, localSession_->attr, attr) != PJ_SUCCESS) - throw SdpException("Could not add ICE.pwd attribute to local SDP"); + throw SdpException("Unable to add ICE.pwd attribute to local SDP"); } dhtnet::IceTransport::Attribute @@ -1074,7 +1074,7 @@ Sdp::getMediaAttributeListFromSdp(const pjmedia_sdp_session* sdpSession, bool ig // Get transport. auto transp = getMediaTransport(media); if (transp == MediaTransport::UNKNOWN) { - JAMI_WARN("Media#%u could not determine transport type!", idx); + JAMI_WARN("Media#%u is unable to determine transport type!", idx); } // A media is secure if the transport is of type RTP/SAVP diff --git a/src/sip/sipaccount.cpp b/src/sip/sipaccount.cpp index d4a12e84a56d3959b365a6112890f1170ac6efd8..a4171649b881307f12e481b719b9d0feacdfcb31 100644 --- a/src/sip/sipaccount.cpp +++ b/src/sip/sipaccount.cpp @@ -253,14 +253,14 @@ SIPAccount::newOutgoingCall(std::string_view toUrl, const std::vector<libjami::M manager.scheduler().run([this, weak_call] { if (auto call = weak_call.lock()) { if (not SIPStartCall(call)) { - JAMI_ERR("Could not send outgoing INVITE request for new call"); + JAMI_ERR("Unable to send outgoing INVITE request for new call"); call->onFailure(); } } return false; }); } else { - throw VoipLinkException("Could not send outgoing INVITE request for new call"); + throw VoipLinkException("Unable to send outgoing INVITE request for new call"); } return call; @@ -323,7 +323,7 @@ SIPAccount::setTransport(const std::shared_ptr<SipTransport>& t) std::placeholders::_2)); // Update contact address and header if (not initContactAddress()) { - JAMI_DEBUG("Can not register: invalid address"); + JAMI_DEBUG("Unable to register: invalid address"); return; } updateContactHeader(); @@ -381,14 +381,14 @@ SIPAccount::SIPStartCall(std::shared_ptr<SIPCall>& call) if (hasCredentials() and pjsip_auth_clt_set_credentials(&dialog->auth_sess, getCredentialCount(), getCredInfo()) != PJ_SUCCESS) { - JAMI_ERROR("Could not initialize credentials for invite session authentication"); + JAMI_ERROR("Unable to initialize credentials for invite session authentication"); return false; } pjsip_tx_data* tdata; if (pjsip_inv_invite(call->inviteSession_.get(), &tdata) != PJ_SUCCESS) { - JAMI_ERROR("Could not initialize invite messager for this call"); + JAMI_ERROR("Unable to initialize invite messager for this call"); return false; } @@ -598,7 +598,7 @@ SIPAccount::doRegister1_() std::lock_guard lock( acc->configurationMutex_); if (host_ips.empty()) { - JAMI_ERR("Can't resolve hostname for registration."); + JAMI_ERR("Unable to resolve hostname for registration."); acc->setRegistrationState(RegistrationState::ERROR_GENERIC, PJSIP_SC_NOT_FOUND); return; @@ -621,7 +621,7 @@ SIPAccount::doRegister2_() dhtnet::IpAddr bindAddress = createBindingAddress(); if (not bindAddress) { setRegistrationState(RegistrationState::ERROR_GENERIC, PJSIP_SC_NOT_FOUND); - JAMI_ERROR("Can't compute address to bind."); + JAMI_ERROR("Unable to compute address to bind."); return; } @@ -674,7 +674,7 @@ SIPAccount::doRegister2_() setTransport(link_.sipTransportBroker->getUdpTransport(bindAddress)); } if (!transport_) - throw VoipLinkException("Can't create transport"); + throw VoipLinkException("Unable to create transport"); sendRegister(); } catch (const VoipLinkException& e) { @@ -1004,7 +1004,7 @@ SIPAccount::initTlsConfiguration() CipherArray avail_ciphers(256); unsigned cipherNum = avail_ciphers.size(); if (pj_ssl_cipher_get_availables(&avail_ciphers.front(), &cipherNum) != PJ_SUCCESS) - JAMI_ERR("Could not determine cipher list on this system"); + JAMI_ERR("Unable to determine cipher list on this system"); avail_ciphers.resize(cipherNum); ciphers_.clear(); @@ -1397,7 +1397,7 @@ SIPAccount::getSupportedTlsCiphers() unsigned cipherNum = 256; CipherArray avail_ciphers(cipherNum); if (pj_ssl_cipher_get_availables(&avail_ciphers.front(), &cipherNum) != PJ_SUCCESS) - JAMI_ERR("Could not determine cipher list on this system"); + JAMI_ERR("Unable to determine cipher list on this system"); avail_ciphers.resize(cipherNum); availCiphers.reserve(cipherNum); for (const auto& item : avail_ciphers) { diff --git a/src/sip/sipaccountbase.h b/src/sip/sipaccountbase.h index 4733b0cefda3e01764119a948ab246990289feec..2a5575885f123a91186af2a3002b0546f82a9e9f 100644 --- a/src/sip/sipaccountbase.h +++ b/src/sip/sipaccountbase.h @@ -164,7 +164,7 @@ public: /** * Socket port generators for media - * Note: given ports are application wide, a port cannot be given again + * Note: given ports are application wide, a port is unable to be given again * by any account instances until it's released by the static method * releasePort(). */ diff --git a/src/sip/sipcall.cpp b/src/sip/sipcall.cpp index 4a4ca9f35f1b7050b6c004227214152f9ac4894a..e0139136d4c52524de398e31b64d2fa11427de7b 100644 --- a/src/sip/sipcall.cpp +++ b/src/sip/sipcall.cpp @@ -620,7 +620,7 @@ SIPCall::sendSIPInfo(std::string_view body, std::string_view subtype) { std::lock_guard lk {callMutex_}; if (not inviteSession_ or not inviteSession_->dlg) - throw VoipLinkException("Couldn't get invite dialog"); + throw VoipLinkException("Unable to get invite dialog"); constexpr pj_str_t methodName = CONST_PJ_STR("INFO"); constexpr pj_str_t type = CONST_PJ_STR("application"); @@ -631,7 +631,7 @@ SIPCall::sendSIPInfo(std::string_view body, std::string_view subtype) /* Create request message. */ pjsip_tx_data* tdata; if (pjsip_dlg_create_request(inviteSession_->dlg, &method, -1, &tdata) != PJ_SUCCESS) { - JAMI_ERR("[call:%s] Could not create dialog", getCallId().c_str()); + JAMI_ERR("[call:%s] Unable to create dialog", getCallId().c_str()); return; } @@ -752,7 +752,7 @@ SIPCall::setInviteSession(pjsip_inv_session* inviteSession) // ref counter and let our unique_ptr share the ownership of the session // with pjsip. if (PJ_SUCCESS != pjsip_inv_add_ref(inviteSession)) { - JAMI_WARN("[call:%s] trying to set invalid invite session [%p]", + JAMI_WARN("[call:%s] Attempting to set invalid invite session [%p]", getCallId().c_str(), inviteSession); inviteSession_.reset(nullptr); @@ -792,12 +792,12 @@ SIPCall::terminateSipSession(int status) ret = pjsip_inv_send_msg(inviteSession_.get(), tdata); if (ret != PJ_SUCCESS) - JAMI_ERR("[call:%s] failed to send terminate msg, SIP error (%s)", + JAMI_ERR("[call:%s] Failed to send terminate msg, SIP error (%s)", getCallId().c_str(), sip_utils::sip_strerror(ret).c_str()); } } else - JAMI_ERR("[call:%s] failed to terminate INVITE@%p, SIP error (%s)", + JAMI_ERR("[call:%s] Failed to terminate INVITE@%p, SIP error (%s)", getCallId().c_str(), inviteSession_.get(), sip_utils::sip_strerror(ret).c_str()); @@ -817,7 +817,7 @@ SIPCall::answer() if (not inviteSession_) throw VoipLinkException("[call:" + getCallId() - + "] answer: no invite session for this call"); + + "] Answer: no invite session for this call"); if (!inviteSession_->neg) { JAMI_WARN("[call:%s] Negotiator is NULL, we've received an INVITE without an SDP", @@ -837,10 +837,10 @@ SIPCall::answer() !inviteSession_->neg ? sdp_->getLocalSdpSession() : NULL, &tdata) != PJ_SUCCESS) - throw std::runtime_error("Could not init invite request answer (200 OK)"); + throw std::runtime_error("Unable to init invite request answer (200 OK)"); if (contactHeader_.empty()) { - throw std::runtime_error("Cant answer with an invalid contact header"); + throw std::runtime_error("Unable to answer with an invalid contact header"); } JAMI_DBG("[call:%s] Answering with contact header: %s", @@ -854,7 +854,7 @@ SIPCall::answer() if (pjsip_inv_send_msg(inviteSession_.get(), tdata) != PJ_SUCCESS) { setInviteSession(); - throw std::runtime_error("Could not send invite request answer (200 OK)"); + throw std::runtime_error("Unable to send invite request answer (200 OK)"); } setState(CallState::ACTIVE, ConnectionState::CONNECTED); @@ -959,11 +959,11 @@ SIPCall::answer(const std::vector<libjami::MediaMap>& mediaList) addLocalIceAttributes(); } } else { - JAMI_WARN("[call:%s] Cant init ICE transport, missing local address", + JAMI_WARN("[call:%s] Unable to init ICE transport, missing local address", getCallId().c_str()); } } else { - JAMI_WARN("[call:%s] Cant init ICE transport, missing public address", + JAMI_WARN("[call:%s] Unable to init ICE transport, missing public address", getCallId().c_str()); } } @@ -976,10 +976,10 @@ SIPCall::answer(const std::vector<libjami::MediaMap>& mediaList) pjsip_tx_data* tdata; if (pjsip_inv_answer(inviteSession_.get(), PJSIP_SC_OK, NULL, sdp_->getLocalSdpSession(), &tdata) != PJ_SUCCESS) - throw std::runtime_error("Could not init invite request answer (200 OK)"); + throw std::runtime_error("Unable to init invite request answer (200 OK)"); if (contactHeader_.empty()) { - throw std::runtime_error("Cant answer with an invalid contact header"); + throw std::runtime_error("Unable to answer with an invalid contact header"); } JAMI_DBG("[call:%s] Answering with contact header: %s", @@ -993,7 +993,7 @@ SIPCall::answer(const std::vector<libjami::MediaMap>& mediaList) if (pjsip_inv_send_msg(inviteSession_.get(), tdata) != PJ_SUCCESS) { setInviteSession(); - throw std::runtime_error("Could not send invite request answer (200 OK)"); + throw std::runtime_error("Unable to send invite request answer (200 OK)"); } setState(CallState::ACTIVE, ConnectionState::CONNECTED); @@ -1055,7 +1055,7 @@ SIPCall::answerMediaChangeRequest(const std::vector<libjami::MediaMap>& mediaLis return; if (not sdp_->processIncomingOffer(mediaAttrList)) { - JAMI_WARN("[call:%s] Could not process the new offer, ignoring", getCallId().c_str()); + JAMI_WARN("[call:%s] Unable to process the new offer, ignoring", getCallId().c_str()); return; } @@ -1070,20 +1070,20 @@ SIPCall::answerMediaChangeRequest(const std::vector<libjami::MediaMap>& mediaLis } if (not sdp_->startNegotiation()) { - JAMI_ERR("[call:%s] Could not start media negotiation for a re-invite request", + JAMI_ERR("[call:%s] Unable to start media negotiation for a re-invite request", getCallId().c_str()); return; } if (pjsip_inv_set_sdp_answer(inviteSession_.get(), sdp_->getLocalSdpSession()) != PJ_SUCCESS) { - JAMI_ERR("[call:%s] Could not start media negotiation for a re-invite request", + JAMI_ERR("[call:%s] Unable to start media negotiation for a re-invite request", getCallId().c_str()); return; } pjsip_tx_data* tdata; if (pjsip_inv_answer(inviteSession_.get(), PJSIP_SC_OK, NULL, NULL, &tdata) != PJ_SUCCESS) { - JAMI_ERR("[call:%s] Could not init answer to a re-invite request", getCallId().c_str()); + JAMI_ERR("[call:%s] Unable to init answer to a re-invite request", getCallId().c_str()); return; } @@ -1095,7 +1095,7 @@ SIPCall::answerMediaChangeRequest(const std::vector<libjami::MediaMap>& mediaLis sip_utils::addUserAgentHeader(account->getUserAgentName(), tdata); if (pjsip_inv_send_msg(inviteSession_.get(), tdata) != PJ_SUCCESS) { - JAMI_ERR("[call:%s] Could not send answer to a re-invite request", getCallId().c_str()); + JAMI_ERR("[call:%s] Unable to send answer to a re-invite request", getCallId().c_str()); setInviteSession(); return; } @@ -1263,8 +1263,8 @@ SIPCall::transferCommon(const pj_str_t* dst) return false; /* Associate this voiplink of call with the client subscription - * We can not just associate call with the client subscription - * because after this function, we can not find the corresponding + * We are unable to just associate call with the client subscription + * because after this function, we are unable to find the corresponding * voiplink from the call any more. But the voiplink is useful! */ pjsip_evsub_set_mod_data(sub, Manager::instance().sipVoIPLink().getModId(), this); @@ -1303,7 +1303,7 @@ SIPCall::transfer(const std::string& to) JAMI_DBG("[call:%s] Transferring to %.*s", getCallId().c_str(), (int) dst.slen, dst.ptr); if (!transferCommon(&dst)) - throw VoipLinkException("Couldn't transfer"); + throw VoipLinkException("Unable to transfer"); } bool @@ -1453,7 +1453,7 @@ SIPCall::internalOffHold(const std::function<void()>& sdp_cb) } // For now, call resume will always require new ICE negotiation. if (SIPSessionReinvite(getMediaAttributeList(), true) != PJ_SUCCESS) { - JAMI_WARN("[call:%s] resuming hold", getCallId().c_str()); + JAMI_WARN("[call:%s] Resuming hold", getCallId().c_str()); if (isWaitingForIceAndMedia_) { remainingRequest_ = Request::HoldingOn; } else { @@ -1736,7 +1736,7 @@ SIPCall::setPeerUaVersion(std::string_view ua) auto pos = ua.find(PACK_NAME); if (pos == std::string_view::npos) { // Must have the expected package name. - JAMI_WARN("Could not find the expected package name in peer's User-Agent"); + JAMI_WARN("Unable to find the expected package name in peer's User-Agent"); return; } @@ -1758,13 +1758,13 @@ SIPCall::setPeerUaVersion(std::string_view ua) } if (version.empty()) { - JAMI_DEBUG("[call:{}] Could not parse peer's version", getCallId()); + JAMI_DEBUG("[call:{}] Unable to parse peer's version", getCallId()); return; } auto peerVersion = split_string_to_unsigned(version, '.'); if (peerVersion.size() > 4u) { - JAMI_WARNING("[call:{}] Could not parse peer's version", getCallId()); + JAMI_WARNING("[call:{}] Unable to parse peer's version", getCallId()); return; } @@ -1900,13 +1900,13 @@ SIPCall::addLocalIceAttributes() for (auto const& stream : rtpStreams_) { if (not stream.mediaAttribute_->enabled_) { // Dont add ICE candidates if the media is disabled - JAMI_DBG("[call:%s] media [%s] @ %u is disabled, dont add local candidates", + JAMI_DBG("[call:%s] Media [%s] @ %u is disabled, dont add local candidates", getCallId().c_str(), stream.mediaAttribute_->toString().c_str(), streamIdx); continue; } - JAMI_DBG("[call:%s] add ICE local candidates for media [%s] @ %u", + JAMI_DBG("[call:%s] Add ICE local candidates for media [%s] @ %u", getCallId().c_str(), stream.mediaAttribute_->toString().c_str(), streamIdx); @@ -1929,7 +1929,7 @@ SIPCall::addLocalIceAttributes() // Skipping local ICE candidates if the media is disabled continue; } - JAMI_DBG("[call:%s] add ICE local candidates for media [%s] @ %u", + JAMI_DBG("[call:%s] Add ICE local candidates for media [%s] @ %u", getCallId().c_str(), stream.mediaAttribute_->toString().c_str(), idx); @@ -2067,10 +2067,10 @@ SIPCall::isCaptureDeviceMuted(const MediaType& mediaType) const void SIPCall::setupNegotiatedMedia() { - JAMI_DBG("[call:%s] updating negotiated media", getCallId().c_str()); + JAMI_DBG("[call:%s] Updating negotiated media", getCallId().c_str()); if (not sipTransport_ or not sdp_) { - JAMI_ERR("[call:%s] the call is in invalid state", getCallId().c_str()); + JAMI_ERR("[call:%s] Call is in an invalid state", getCallId().c_str()); return; } @@ -2233,7 +2233,7 @@ SIPCall::startAllMedia() void SIPCall::restartMediaSender() { - JAMI_DBG("[call:%s] restarting TX media streams", getCallId().c_str()); + JAMI_DBG("[call:%s] Restarting TX media streams", getCallId().c_str()); for (const auto& rtpSession : getRtpSessionList()) rtpSession->restartSender(); } @@ -2308,16 +2308,16 @@ SIPCall::muteMedia(const std::string& mediaType, bool mute) auto type = MediaAttribute::stringToMediaType(mediaType); if (type == MediaType::MEDIA_AUDIO) { - JAMI_WARN("[call:%s] %s all audio medias", + JAMI_WARN("[call:%s] %s all audio media", getCallId().c_str(), mute ? "muting " : "un-muting "); } else if (type == MediaType::MEDIA_VIDEO) { - JAMI_WARN("[call:%s] %s all video medias", + JAMI_WARN("[call:%s] %s all video media", getCallId().c_str(), mute ? "muting" : "un-muting"); } else { - JAMI_ERR("[call:%s] invalid media type %s", getCallId().c_str(), mediaType.c_str()); + JAMI_ERR("[call:%s] Invalid media type %s", getCallId().c_str(), mediaType.c_str()); assert(false); } @@ -2954,7 +2954,7 @@ SIPCall::onReceiveReinvite(const pjmedia_sdp_session* offer, pjsip_rx_data* rdat pjsip_tx_data* tdata = nullptr; if (pjsip_inv_initial_answer(inviteSession_.get(), rdata, PJSIP_SC_TRYING, NULL, NULL, &tdata) != PJ_SUCCESS) { - JAMI_ERR("[call:%s] Could not create answer TRYING", getCallId().c_str()); + JAMI_ERR("[call:%s] Unable to create answer TRYING", getCallId().c_str()); return res; } @@ -2988,7 +2988,7 @@ SIPCall::onReceiveOfferIn200OK(const pjmedia_sdp_session* offer) } if (not sdp_) { - JAMI_ERR("invalid SDP session"); + JAMI_ERR("Invalid SDP session"); return; } @@ -3033,7 +3033,7 @@ SIPCall::onReceiveOfferIn200OK(const pjmedia_sdp_session* offer) sdp_->startNegotiation(); if (pjsip_inv_set_sdp_answer(inviteSession_.get(), sdp_->getLocalSdpSession()) != PJ_SUCCESS) { - JAMI_ERR("[call:%s] Could not start media negotiation for a re-invite request", + JAMI_ERR("[call:%s] Unable to start media negotiation for a re-invite request", getCallId().c_str()); } } @@ -3055,7 +3055,7 @@ SIPCall::openPortsUPnP() * No need to request mappings for specfic port numbers. Set the port to '0' to * request the first available port (faster and more likely to succeed). */ - JAMI_DBG("[call:%s] opening ports via UPNP for SDP session", getCallId().c_str()); + JAMI_DBG("[call:%s] Opening ports via UPNP for SDP session", getCallId().c_str()); // RTP port. upnp_->reserveMapping(sdp_->getLocalAudioPort(), dhtnet::upnp::PortType::UDP); @@ -3512,7 +3512,7 @@ SIPCall::getLocalIceCandidates(unsigned compId) const { std::lock_guard lk(transportMtx_); if (not iceMedia_) { - JAMI_WARN("[call:%s] no media ICE transport", getCallId().c_str()); + JAMI_WARN("[call:%s] No media ICE transport", getCallId().c_str()); return {}; } return iceMedia_->getLocalCandidates(compId); @@ -3531,7 +3531,7 @@ SIPCall::resetTransport(std::shared_ptr<dhtnet::IceTransport>&& transport) void SIPCall::merge(Call& call) { - JAMI_DBG("[call:%s] merge subcall %s", getCallId().c_str(), call.getCallId().c_str()); + JAMI_DBG("[call:%s] Merge subcall %s", getCallId().c_str(), call.getCallId().c_str()); // This static cast is safe as this method is private and overload Call::merge auto& subcall = static_cast<SIPCall&>(call); @@ -3638,7 +3638,7 @@ SIPCall::setupIceResponse(bool isReinvite) } if (not opt.accountLocalAddr) { - JAMI_ERR("[call:%s] No local address, ICE can't be initialized", getCallId().c_str()); + JAMI_ERR("[call:%s] No local address, unable to initialize ICE", getCallId().c_str()); onFailure(EIO); return; } @@ -3716,7 +3716,7 @@ SIPCall::peerMuted(bool muted, int streamIdx) if (muted) { JAMI_WARN("Peer muted"); } else { - JAMI_WARN("Peer un-muted"); + JAMI_WARN("Peer unmuted"); } if (streamIdx == -1) { diff --git a/src/sip/sippresence.cpp b/src/sip/sippresence.cpp index 73a60d1be17868a7c2d7e9e0689c20e6af8cb18c..e47211e18c3851293cc5aee7c6b3d1c6454c2a9d 100644 --- a/src/sip/sippresence.cpp +++ b/src/sip/sippresence.cpp @@ -61,7 +61,7 @@ SIPPresence::SIPPresence(SIPAccount* acc) pj_caching_pool_init(&cp_, &pj_pool_factory_default_policy, 0); pool_ = pj_pool_create(&cp_.factory, "pres", 1000, 1000, NULL); if (!pool_) - throw std::runtime_error("Could not allocate pool for presence"); + throw std::runtime_error("Unable to allocate pool for presence"); /* init default status */ updateStatus(false, " "); @@ -70,7 +70,7 @@ SIPPresence::SIPPresence(SIPAccount* acc) SIPPresence::~SIPPresence() { /* Flush the lists */ - // FIXME: Can't destroy/unsubscribe buddies properly. + // FIXME: Unable to destroy/unsubscribe buddies properly. // Is the transport usable when the account is being destroyed? // for (const auto & c : sub_client_list_) // delete(c); @@ -228,7 +228,7 @@ SIPPresence::subscribeClient(const std::string& uri, bool flag) } if (sub_client_list_.size() >= MAX_N_SUB_CLIENT) { - JAMI_WARN("Can't add PresSubClient, max number reached."); + JAMI_WARN("Unable to add PresSubClient, max number reached."); return; } @@ -527,7 +527,7 @@ SIPPresence::publish(SIPPresence* pres) acc->getCredentialCount(), acc->getCredInfo()) != PJ_SUCCESS) { - JAMI_ERR("Could not initialize credentials for invite session authentication"); + JAMI_ERR("Unable to initialize credentials for invite session authentication"); return status; } diff --git a/src/sip/siptransport.cpp b/src/sip/siptransport.cpp index da9d52cac251e6226eb17fc2d7fbef0d5257cefb..423865e526b0b5219bb358cad6c129c93fad8470 100644 --- a/src/sip/siptransport.cpp +++ b/src/sip/siptransport.cpp @@ -313,7 +313,7 @@ SipTransportBroker::getUdpTransport(const dhtnet::IpAddr& ipAddress) std::shared_ptr<SipTransport> SipTransportBroker::createUdpTransport(const dhtnet::IpAddr& ipAddress) { - RETURN_IF_FAIL(ipAddress, nullptr, "Could not determine IP address for this transport"); + RETURN_IF_FAIL(ipAddress, nullptr, "Unable to determine IP address for this transport"); pjsip_udp_transport_cfg pj_cfg; pjsip_udp_transport_cfg_default(&pj_cfg, ipAddress.getFamily()); @@ -337,7 +337,7 @@ std::shared_ptr<TlsListener> SipTransportBroker::getTlsListener(const dhtnet::IpAddr& ipAddress, const pjsip_tls_setting* settings) { RETURN_IF_FAIL(settings, nullptr, "TLS settings not specified"); - RETURN_IF_FAIL(ipAddress, nullptr, "Could not determine IP address for this transport"); + RETURN_IF_FAIL(ipAddress, nullptr, "Unable to determine IP address for this transport"); JAMI_DEBUG("Creating TLS listener on {:s}...", ipAddress.toString(true)); #if 0 JAMI_DBG(" ca_list_file : %s", settings->ca_list_file.ptr); @@ -387,7 +387,7 @@ SipTransportBroker::getTlsTransport(const std::shared_ptr<TlsListener>& l, &transport); if (!transport || status != PJ_SUCCESS) { - JAMI_ERR("Could not get new TLS transport: %s", sip_utils::sip_strerror(status).c_str()); + JAMI_ERR("Unable to get new TLS transport: %s", sip_utils::sip_strerror(status).c_str()); return nullptr; } auto ret = std::make_shared<SipTransport>(transport, l); diff --git a/src/sip/sipvoiplink.cpp b/src/sip/sipvoiplink.cpp index 9ed6532ccdbbbd29d326c7383fba2edf320f999f..db92a37f2c1decafd0eaf01f98731b81d5d742ba 100644 --- a/src/sip/sipvoiplink.cpp +++ b/src/sip/sipvoiplink.cpp @@ -394,7 +394,7 @@ transaction_request_cb(pjsip_rx_data* rdata) unsigned options = 0; if (pjsip_inv_verify_request(rdata, &options, NULL, NULL, endpt_, NULL) != PJ_SUCCESS) { - JAMI_ERR("Couldn't verify INVITE request in secure dialog."); + JAMI_ERR("Unable to verify INVITE request in secure dialog."); try_respond_stateless(endpt_, rdata, PJSIP_SC_METHOD_NOT_ALLOWED, NULL, NULL, NULL); return PJ_FALSE; } @@ -464,7 +464,7 @@ transaction_request_cb(pjsip_rx_data* rdata) pjsip_dialog* dialog = nullptr; if (pjsip_dlg_create_uas_and_inc_lock(pjsip_ua_instance(), rdata, nullptr, &dialog) != PJ_SUCCESS) { - JAMI_ERR("Could not create uas"); + JAMI_ERR("Unable to create uas"); call.reset(); try_respond_stateless(endpt_, rdata, @@ -477,7 +477,7 @@ transaction_request_cb(pjsip_rx_data* rdata) pjsip_tpselector tp_sel = SIPVoIPLink::getTransportSelector(transport->get()); if (!dialog or pjsip_dlg_set_transport(dialog, &tp_sel) != PJ_SUCCESS) { - JAMI_ERR("Could not set transport for dialog"); + JAMI_ERR("Unable to set transport for dialog"); if (dialog) pjsip_dlg_dec_lock(dialog); return PJ_FALSE; @@ -530,7 +530,7 @@ transaction_request_cb(pjsip_rx_data* rdata) NULL, &tdata) != PJ_SUCCESS) { - JAMI_ERR("Could not create answer TRYING"); + JAMI_ERR("Unable to create answer TRYING"); return PJ_FALSE; } @@ -538,7 +538,7 @@ transaction_request_cb(pjsip_rx_data* rdata) sip_utils::addUserAgentHeader(account->getUserAgentName(), tdata); if (pjsip_inv_send_msg(call->inviteSession_.get(), tdata) != PJ_SUCCESS) { - JAMI_ERR("Could not send msg TRYING"); + JAMI_ERR("Unable to send msg TRYING"); return PJ_FALSE; } @@ -546,13 +546,13 @@ transaction_request_cb(pjsip_rx_data* rdata) if (pjsip_inv_answer(call->inviteSession_.get(), PJSIP_SC_RINGING, NULL, NULL, &tdata) != PJ_SUCCESS) { - JAMI_ERR("Could not create answer RINGING"); + JAMI_ERR("Unable to create answer RINGING"); return PJ_FALSE; } sip_utils::addContactHeader(call->getContactHeader(), tdata); if (pjsip_inv_send_msg(call->inviteSession_.get(), tdata) != PJ_SUCCESS) { - JAMI_ERR("Could not send msg RINGING"); + JAMI_ERR("Unable to send msg RINGING"); return PJ_FALSE; } @@ -627,7 +627,7 @@ SIPVoIPLink::SIPVoIPLink() pj_caching_pool_init(&cp_, &pj_pool_factory_default_policy, 0); pool_.reset(pj_pool_create(&cp_.factory, PACKAGE, 64 * 1024, 4096, nullptr)); if (!pool_) - throw VoipLinkException("UserAgent: Could not initialize memory pool"); + throw VoipLinkException("UserAgent: Unable to initialize memory pool"); TRY(pjsip_endpt_create(&cp_.factory, pj_gethostname()->ptr, &endpt_)); @@ -673,7 +673,7 @@ SIPVoIPLink::SIPVoIPLink() auto status = pjsip_tpmgr_set_state_cb(pjsip_endpt_get_tpmgr(endpt_), tp_state_callback); if (status != PJ_SUCCESS) - JAMI_ERR("Can't set transport callback: %s", sip_utils::sip_strerror(status).c_str()); + JAMI_ERR("Unable to set transport callback: %s", sip_utils::sip_strerror(status).c_str()); TRY(pjsip_tsx_layer_init_module(endpt_)); TRY(pjsip_ua_init_module(endpt_, nullptr)); @@ -829,7 +829,7 @@ SIPVoIPLink::registerKeepAliveTimer(pj_timer_entry& timer, pj_time_val& delay) break; default: - JAMI_ERR("Could not schedule new timer in pjsip endpoint"); + JAMI_ERR("Unable to schedule new timer in pjsip endpoint"); /* fallthrough */ case PJ_EINVAL: @@ -1272,7 +1272,7 @@ static bool transferCall(SIPCall& call, const std::string& refer_to) { const auto& callId = call.getCallId(); - JAMI_WARN("[call:%s] Trying to transfer to %s", callId.c_str(), refer_to.c_str()); + JAMI_WARN("[call:%s] Attempting to transfer to %s", callId.c_str(), refer_to.c_str()); try { Manager::instance().newOutgoingCall(refer_to, call.getAccountId(), @@ -1291,7 +1291,7 @@ replyToRequest(pjsip_inv_session* inv, pjsip_rx_data* rdata, int status_code) { const auto ret = pjsip_dlg_respond(inv->dlg, rdata, status_code, nullptr, nullptr, nullptr); if (ret != PJ_SUCCESS) - JAMI_WARN("SIP: failed to reply %d to request", status_code); + JAMI_WARN("SIP: Failed to reply %d to request", status_code); } static void @@ -1446,7 +1446,7 @@ void SIPVoIPLink::createSDPOffer(pjsip_inv_session* inv) { if (inv == nullptr) { - throw VoipLinkException("Invite session can not be null"); + throw VoipLinkException("Invite session is unable to be null"); } sdp_create_offer_cb(inv, nullptr); } @@ -1532,7 +1532,7 @@ SIPVoIPLink::resolveSrvName(const std::string& name, token, [=, cb = std::move(cb)](pj_status_t s, const pjsip_server_addresses* r) { try { if (s != PJ_SUCCESS || !r) { - JAMI_WARN("Can't resolve \"%s\" using pjsip_endpt_resolve, trying getaddrinfo.", + JAMI_WARN("Unable to resolve \"%s\" using pjsip_endpt_resolve, trying getaddrinfo.", name.c_str()); dht::ThreadPool::io().run([=, cb = std::move(cb)]() { auto ips = dhtnet::ip_utils::getAddrList(name.c_str()); @@ -1598,7 +1598,7 @@ SIPVoIPLink::findLocalAddressFromTransport(pjsip_transport* transport, pjsip_tpmgr_fla2_param param = {transportType, &tp_sel, pjstring, PJ_FALSE, {nullptr, 0}, 0, nullptr}; if (pjsip_tpmgr_find_local_addr2(tpmgr, pool_.get(), ¶m) != PJ_SUCCESS) { - JAMI_WARN("Could not retrieve local address and port from transport, using %s :%d", + JAMI_WARN("Unable to retrieve local address and port from transport, using %s :%d", addr.c_str(), port); return; diff --git a/src/string_utils.cpp b/src/string_utils.cpp index 48e62375727b6d46617dc7fbabe7bb0793692504..b3d4fb13a4cab77db12819f12a27639ffa5b290c 100644 --- a/src/string_utils.cpp +++ b/src/string_utils.cpp @@ -49,11 +49,11 @@ to_wstring(const std::string& str, int codePage) int srcLength = (int) str.length(); int requiredSize = MultiByteToWideChar(codePage, 0, str.c_str(), srcLength, nullptr, 0); if (!requiredSize) { - throw std::runtime_error("Can't convert string to wstring"); + throw std::runtime_error("Unable to convert string to wstring"); } std::wstring result((size_t) requiredSize, 0); if (!MultiByteToWideChar(codePage, 0, str.c_str(), srcLength, &(*result.begin()), requiredSize)) { - throw std::runtime_error("Can't convert string to wstring"); + throw std::runtime_error("Unable to convert string to wstring"); } return result; } @@ -64,12 +64,12 @@ to_string(const std::wstring& wstr, int codePage) int srcLength = (int) wstr.length(); int requiredSize = WideCharToMultiByte(codePage, 0, wstr.c_str(), srcLength, nullptr, 0, 0, 0); if (!requiredSize) { - throw std::runtime_error("Can't convert wstring to string"); + throw std::runtime_error("Unable to convert wstring to string"); } std::string result((size_t) requiredSize, 0); if (!WideCharToMultiByte( codePage, 0, wstr.c_str(), srcLength, &(*result.begin()), requiredSize, 0, 0)) { - throw std::runtime_error("Can't convert wstring to string"); + throw std::runtime_error("Unable to convert wstring to string"); } return result; } @@ -81,7 +81,7 @@ to_string(double value) char buf[64]; int len = snprintf(buf, sizeof(buf), "%-.*G", 16, value); if (len <= 0) - throw std::invalid_argument {"can't parse double"}; + throw std::invalid_argument {"Unable to parse double"}; return {buf, (size_t) len}; } @@ -96,7 +96,7 @@ from_hex_string(const std::string& str) { uint64_t id; if (auto [p, ec] = std::from_chars(str.data(), str.data()+str.size(), id, 16); ec != std::errc()) { - throw std::invalid_argument("Can't parse id: " + str); + throw std::invalid_argument("Unable to parse id: " + str); } return id; } diff --git a/src/string_utils.h b/src/string_utils.h index 01ef3ed20455613749542c4b394fdd970a7b7741..9ca821728df529ca2ac7fd19a12cef5f4a4a04d7 100644 --- a/src/string_utils.h +++ b/src/string_utils.h @@ -76,9 +76,9 @@ to_int(std::string_view str) if (ec == std::errc()) return result; if (ec == std::errc::invalid_argument) - throw std::invalid_argument("Can't parse integer: invalid_argument"); + throw std::invalid_argument("Unable to parse integer: invalid_argument"); else if (ec == std::errc::result_out_of_range) - throw std::out_of_range("Can't parse integer: out of range"); + throw std::out_of_range("Unable to parse integer: out of range"); throw std::system_error(std::make_error_code(ec)); } diff --git a/src/threadloop.h b/src/threadloop.h index 36e4616c868481030fe01076c2b18a45ddaa0645..3f43b2ccb10ec8999cfcda19ea50629d9a0f3f63 100644 --- a/src/threadloop.h +++ b/src/threadloop.h @@ -95,7 +95,7 @@ public: void wait_for(const std::chrono::duration<Rep, Period>& rel_time) { if (std::this_thread::get_id() != get_id()) - throw std::runtime_error("can not call wait_for outside thread context"); + throw std::runtime_error("Unable to call wait_for outside thread context"); std::unique_lock lk(mutex_); cv_.wait_for(lk, rel_time, [this]() { return isStopping(); }); @@ -105,7 +105,7 @@ public: bool wait_for(const std::chrono::duration<Rep, Period>& rel_time, Pred&& pred) { if (std::this_thread::get_id() != get_id()) - throw std::runtime_error("can not call wait_for outside thread context"); + throw std::runtime_error("Unable to call wait_for outside thread context"); std::unique_lock lk(mutex_); return cv_.wait_for(lk, rel_time, [this, pred] { return isStopping() || pred(); }); @@ -115,7 +115,7 @@ public: void wait(Pred&& pred) { if (std::this_thread::get_id() != get_id()) - throw std::runtime_error("Can not call wait outside thread context"); + throw std::runtime_error("Unable to call wait outside thread context"); std::unique_lock lk(mutex_); cv_.wait(lk, [this, p = std::forward<Pred>(pred)] { return isStopping() || p(); }); diff --git a/src/windirent.h b/src/windirent.h index ee9f5528537b23828dea59dd0d34f819e29fc597..86347c45efd40200829119a0ff2160684b049eb9 100644 --- a/src/windirent.h +++ b/src/windirent.h @@ -145,7 +145,7 @@ #define S_IXOTH 0 #endif -/* Maximum length of file name */ +/* Maximum length of filename */ #if !defined(PATH_MAX) #define PATH_MAX MAX_PATH #endif @@ -171,10 +171,10 @@ #define DTTOIF(type) (type) /* - * File type macros. Note that block devices, sockets and links cannot be - * distinguished on Windows and the macros S_ISBLK, S_ISSOCK and S_ISLNK are - * only defined for compatibility. These macros should always return false - * on Windows. + * File type macros. Note that block devices, sockets and links are unable to be + * distinguished on Windows and the macros S_ISBLK, S_ISSOCK and + * S_ISLNK are only defined for compatibility. + * These macros should always return false on Windows. */ #if !defined(S_ISFIFO) #define S_ISFIFO(mode) (((mode) &S_IFMT) == S_IFIFO) @@ -223,7 +223,7 @@ struct _wdirent /* File type */ int d_type; - /* File name */ + /* Filename */ wchar_t d_name[PATH_MAX]; }; typedef struct _wdirent _wdirent; @@ -275,7 +275,7 @@ struct dirent /* File type */ int d_type; - /* File name */ + /* Filename */ char d_name[PATH_MAX]; }; typedef struct dirent dirent; @@ -385,24 +385,24 @@ _wopendir(const wchar_t* dirname) /* Directory stream opened successfully */ error = 0; } else { - /* Cannot retrieve first entry */ + /* Unable to retrieve first entry */ error = 1; dirent_set_errno(ENOENT); } } else { - /* Cannot retrieve full path name */ + /* Unable to retrieve full path name */ dirent_set_errno(ENOENT); error = 1; } } else { - /* Cannot allocate memory for search pattern */ + /* Unable to allocate memory for search pattern */ error = 1; } } else { - /* Cannot allocate _WDIR structure */ + /* Unable to allocate _WDIR structure */ error = 1; } @@ -437,8 +437,8 @@ _wreaddir(_WDIR* dirp) entp = &dirp->ent; /* - * Copy file name as wide-character string. If the file name is too - * long to fit in to the destination buffer, then truncate file name + * Copy filename as wide-character string. If the filename is too + * long to fit in to the destination buffer, then truncate filename * to PATH_MAX characters and zero-terminate the buffer. */ n = 0; @@ -448,7 +448,7 @@ _wreaddir(_WDIR* dirp) } dirp->ent.d_name[n] = 0; - /* Length of file name excluding zero terminator */ + /* Length of filename excluding zero terminator */ entp->d_namlen = n; /* File type */ @@ -509,7 +509,7 @@ _wclosedir(_WDIR* dirp) /* * Rewind directory stream such that _wreaddir() returns the very first - * file name again. + * filename again. */ static void _wrewinddir(_WDIR* dirp) @@ -619,7 +619,7 @@ opendir(const char* dirname) } else { /* - * Cannot convert file name to wide-character string. This + * Unable to convert filename to wide-character string. This * occurs if the string contains invalid multi-byte sequences or * the output buffer is too small to contain the resulting * string. @@ -628,7 +628,7 @@ opendir(const char* dirname) } } else { - /* Cannot allocate DIR structure */ + /* Unable to allocate DIR structure */ error = 1; } @@ -644,10 +644,10 @@ opendir(const char* dirname) /* * Read next directory entry. * - * When working with text consoles, please note that file names returned by + * When working with text consoles, please note that filenames returned by * readdir() are represented in the default ANSI code page while any output to * console is typically formatted on another code page. Thus, non-ASCII - * characters in file names will not usually display correctly on console. The + * characters in filenames will not usually display correctly on console. The * problem can be fixed in two ways: (1) change the character set of console * to 1252 using chcp utility and use Lucida Console font, or (2) use * _cprintf function when writing to console. The _cprinf() will re-encode @@ -666,16 +666,16 @@ readdir(DIR* dirp) size_t n; int error; - /* Attempt to convert file name to multi-byte string */ + /* Attempt to convert filename to multi-byte string */ error = dirent_wcstombs_s(&n, dirp->ent.d_name, PATH_MAX, datap->cFileName, PATH_MAX); /* - * If the file name cannot be represented by a multi-byte string, - * then attempt to use old 8+3 file name. This allows traditional - * Unix-code to access some file names despite of unicode - * characters, although file names may seem unfamiliar to the user. + * If the filename is unable to be represented by a multi-byte string, + * then attempt to use old 8.3 filename. This allows traditional + * Unix-code to access some filenames despite of unicode + * characters, although filenames may seem unfamiliar to the user. * - * Be ware that the code below cannot come up with a short file + * Beware that the code below is unable to come up with a short file * name unless the file system provides one. At least * VirtualBox shared folders fail to do this. */ @@ -693,7 +693,7 @@ readdir(DIR* dirp) /* Initialize directory entry for return */ entp = &dirp->ent; - /* Length of file name excluding zero terminator */ + /* Length of filename excluding zero terminator */ entp->d_namlen = n - 1; /* File attributes */ @@ -712,9 +712,9 @@ readdir(DIR* dirp) } else { /* - * Cannot convert file name to multi-byte string so construct + * Unable to convert filename to multi-byte string so construct * an errornous directory entry and return that. Note that - * we cannot return NULL as that would stop the processing + * it is unable to return NULL as that would stop the processing * of directory entries completely. */ entp = &dirp->ent; @@ -804,7 +804,7 @@ dirent_mbstowcs_s( error = 0; } else { - /* Could not convert string */ + /* Unable to convert string */ error = 1; } @@ -853,7 +853,7 @@ dirent_wcstombs_s(size_t* pReturnValue, error = 0; } else { - /* Cannot convert string */ + /* Unable to convert string */ error = 1; } diff --git a/test/agent/build-aux/pre-inst-env.in b/test/agent/build-aux/pre-inst-env.in index 642adb77ad2f3445172937544688cc6444e3ce39..04bead03df15b1a311b4b2757e1cbdb99e613fe4 100644 --- a/test/agent/build-aux/pre-inst-env.in +++ b/test/agent/build-aux/pre-inst-env.in @@ -26,7 +26,7 @@ # "./pre-inst-env agent" # By default we may end up with absolute directory names that contain '..', -# which get into $GUILE_LOAD_PATH, leading to '..' in the module file names +# which get into $GUILE_LOAD_PATH, leading to '..' in the module filenames # recorded by Guile. To avoid that, make sure we get a real absolute directory # name. Additionally, use '-P' to get the canonical directory name so that # Guile's 'relative' %file-port-name-canonicalization can actually work (see diff --git a/test/agent/scenarios/bulk-calls/scenario.scm b/test/agent/scenarios/bulk-calls/scenario.scm index e0e24572c86426023d45662d91a561f0063aad1e..1b7e197b05eac73cfe1cdf26c9ceee80d8906943 100644 --- a/test/agent/scenarios/bulk-calls/scenario.scm +++ b/test/agent/scenarios/bulk-calls/scenario.scm @@ -50,7 +50,7 @@ (unless (agent:make-friend me bob-id) (raise-exception (make-exception - (make-exception-with-message "Can't make friend with bob")))) + (make-exception-with-message "Unable to make friend with bob")))) (define (call-bob timeout) (let ((this-call-id "")) diff --git a/test/unitTest/account_archive/account_archive.cpp b/test/unitTest/account_archive/account_archive.cpp index 8c70d6c0d2b97eb7a356e4bade1b4366accb87de..b7bfed5280542e1e399666c7a796a5e533334734 100644 --- a/test/unitTest/account_archive/account_archive.cpp +++ b/test/unitTest/account_archive/account_archive.cpp @@ -262,7 +262,7 @@ AccountArchiveTest::testExportDhtWrongPassword() void AccountArchiveTest::testChangePassword() { - // Test wrong password, should fail + // Test incorrect password, should fail CPPUNIT_ASSERT(!libjami::changeAccountPassword(aliceId, "wrong", "new")); // Test correct password, should succeed CPPUNIT_ASSERT(libjami::changeAccountPassword(aliceId, "", "new")); diff --git a/test/unitTest/call/conference.cpp b/test/unitTest/call/conference.cpp index 6f25e37e0ff985a17e64e53c577c85826ebc5c9e..36796ba84f6e5a4685bff4e8ea402d6a69e7d88a 100644 --- a/test/unitTest/call/conference.cpp +++ b/test/unitTest/call/conference.cpp @@ -327,7 +327,7 @@ ConferenceTest::startConference(bool audioOnly, bool addDavi) confChanged = false; Manager::instance().joinParticipant(aliceId, call1, aliceId, call2); // ConfChanged is the signal emitted when the 2 calls will be added to the conference - // Also, wait that participants appears in conf info to get all good informations + // Also, wait for participants to appear in conf info to get all good information CPPUNIT_ASSERT(cv.wait_for(lk, 20s, [&] { return !confId.empty() && confChanged && !carlaCall.device.empty() && !bobCall.device.empty(); diff --git a/test/unitTest/conversation/conversation.cpp b/test/unitTest/conversation/conversation.cpp index d893aa75816dbd047886151f0321cb95e9e6b8c2..52dc16fbb6e54fbcf58090ce0fdf2c8bcbe7cab6 100644 --- a/test/unitTest/conversation/conversation.cpp +++ b/test/unitTest/conversation/conversation.cpp @@ -1137,7 +1137,7 @@ ConversationTest::createFakeConversation(std::shared_ptr<JamiAccount> account, opts.flags |= GIT_REPOSITORY_INIT_MKPATH; opts.initial_head = "main"; if (git_repository_init_ext(&repo_ptr, repoPath.c_str(), &opts) < 0) { - JAMI_ERR("Couldn't create a git repository in %s", repoPath.c_str()); + JAMI_ERR("Unable to create a git repository in %s", repoPath.c_str()); } GitRepository repo {std::move(repo_ptr), git_repository_free}; @@ -1164,7 +1164,7 @@ ConversationTest::createFakeConversation(std::shared_ptr<JamiAccount> account, auto adminPath = adminsPath / fmt::format("{}.crt", parentCert->getId()); std::ofstream file(adminPath, std::ios::trunc | std::ios::binary); if (!file.is_open()) { - JAMI_ERROR("Could not write data to %s", adminPath.c_str()); + JAMI_ERROR("Unable to write data to %s", adminPath.c_str()); } file << parentCert->toString(true); file.close(); @@ -1177,7 +1177,7 @@ ConversationTest::createFakeConversation(std::shared_ptr<JamiAccount> account, auto devicePath = devicesPath / fmt::format("{}.crt", cert->getLongId()); file = std::ofstream(devicePath, std::ios::trunc | std::ios::binary); if (!file.is_open()) { - JAMI_ERR("Could not write data to %s", devicePath.c_str()); + JAMI_ERR("Unable to write data to %s", devicePath.c_str()); } file << (fakeCert.empty() ? deviceCert : fakeCert); file.close(); @@ -1213,7 +1213,7 @@ ConversationTest::createFakeConversation(std::shared_ptr<JamiAccount> account, GitSignature sig {sig_ptr, git_signature_free}; if (git_repository_index(&index_ptr, repo.get()) < 0) { - JAMI_ERR("Could not open repository index"); + JAMI_ERR("Unable to open repository index"); } GitIndex index {index_ptr, git_index_free}; @@ -1222,7 +1222,7 @@ ConversationTest::createFakeConversation(std::shared_ptr<JamiAccount> account, } if (git_tree_lookup(&tree_ptr, repo.get(), &tree_id) < 0) { - JAMI_ERR("Could not look up initial tree"); + JAMI_ERR("Unable to look up initial tree"); } GitTree tree = {tree_ptr, git_tree_free}; @@ -1243,7 +1243,7 @@ ConversationTest::createFakeConversation(std::shared_ptr<JamiAccount> account, 0, nullptr) < 0) { - JAMI_ERR("Could not create initial buffer"); + JAMI_ERR("Unable to create initial buffer"); return {}; } @@ -1258,7 +1258,7 @@ ConversationTest::createFakeConversation(std::shared_ptr<JamiAccount> account, signed_str.c_str(), "signature") < 0) { - JAMI_ERR("Could not sign initial commit"); + JAMI_ERR("Unable to sign initial commit"); return {}; } diff --git a/test/unitTest/conversation/conversationcommon.cpp b/test/unitTest/conversation/conversationcommon.cpp index 54867066adb1356c538a4de147ee9620b4e2fabc..80599cabb18649ccfed4cf5c7ee9c68fb5bb4328 100644 --- a/test/unitTest/conversation/conversationcommon.cpp +++ b/test/unitTest/conversation/conversationcommon.cpp @@ -212,12 +212,12 @@ commitInRepo(const std::string& path, std::shared_ptr<JamiAccount> account, cons git_repository* repo = nullptr; // TODO share this repo with GitServer if (git_repository_open(&repo, path.c_str()) != 0) { - JAMI_ERROR("Could not open repository"); + JAMI_ERROR("Unable to open repository"); return {}; } if (git_repository_index(&index_ptr, repo) < 0) { - JAMI_ERROR("Could not open repository index"); + JAMI_ERROR("Unable to open repository index"); return {}; } GitIndex index {index_ptr, git_index_free}; @@ -230,20 +230,20 @@ commitInRepo(const std::string& path, std::shared_ptr<JamiAccount> account, cons git_tree* tree_ptr = nullptr; if (git_tree_lookup(&tree_ptr, repo, &tree_id) < 0) { - JAMI_ERROR("Could not look up initial tree"); + JAMI_ERROR("Unable to look up initial tree"); return {}; } GitTree tree = {tree_ptr, git_tree_free}; git_oid commit_id; if (git_reference_name_to_id(&commit_id, repo, "HEAD") < 0) { - JAMI_ERROR("Cannot get reference for HEAD"); + JAMI_ERROR("Unable to get reference for HEAD"); return {}; } git_commit* head_ptr = nullptr; if (git_commit_lookup(&head_ptr, repo, &commit_id) < 0) { - JAMI_ERROR("Could not look up HEAD commit"); + JAMI_ERROR("Unable to look up HEAD commit"); return {}; } GitCommit head_commit {head_ptr, git_commit_free}; @@ -259,7 +259,7 @@ commitInRepo(const std::string& path, std::shared_ptr<JamiAccount> account, cons if (git_commit_create_buffer( &to_sign, repo, sig.get(), sig.get(), nullptr, msg.c_str(), tree.get(), 1, &head_ref[0]) < 0) { - JAMI_ERROR("Could not create commit buffer"); + JAMI_ERROR("Unable to create commit buffer"); return {}; } @@ -275,7 +275,7 @@ commitInRepo(const std::string& path, std::shared_ptr<JamiAccount> account, cons < 0) { const git_error* err = giterr_last(); if (err) - JAMI_ERROR("Could not sign commit: {}", err->message); + JAMI_ERROR("Unable to sign commit: {}", err->message); return {}; } @@ -284,7 +284,7 @@ commitInRepo(const std::string& path, std::shared_ptr<JamiAccount> account, cons if (git_reference_create(&ref_ptr, repo, "refs/heads/main", &commit_id, true, nullptr) < 0) { const git_error* err = giterr_last(); if (err) - JAMI_ERROR("Could not move commit to main: {}", err->message); + JAMI_ERROR("Unable to move commit to main: {}", err->message); return {}; } git_reference_free(ref_ptr); diff --git a/test/unitTest/conversationRepository/conversationRepository.cpp b/test/unitTest/conversationRepository/conversationRepository.cpp index 0a3f74cc3f6d1900c12fdc285ad28d2177213713..dee2660c12128ca0526de6d2c9077b79002bc5bc 100644 --- a/test/unitTest/conversationRepository/conversationRepository.cpp +++ b/test/unitTest/conversationRepository/conversationRepository.cpp @@ -261,13 +261,13 @@ ConversationRepositoryTest::addCommit(git_repository* repo, // Retrieve current HEAD git_oid commit_id; if (git_reference_name_to_id(&commit_id, repo, "HEAD") < 0) { - JAMI_ERR("Cannot get reference for HEAD"); + JAMI_ERR("Unable to get reference for HEAD"); return {}; } git_commit* head_ptr = nullptr; if (git_commit_lookup(&head_ptr, repo, &commit_id) < 0) { - JAMI_ERR("Could not look up HEAD commit"); + JAMI_ERR("Unable to look up HEAD commit"); return {}; } GitCommit head_commit {head_ptr, git_commit_free}; @@ -275,7 +275,7 @@ ConversationRepositoryTest::addCommit(git_repository* repo, // Retrieve current index git_index* index_ptr = nullptr; if (git_repository_index(&index_ptr, repo) < 0) { - JAMI_ERR("Could not open repository index"); + JAMI_ERR("Unable to open repository index"); return {}; } GitIndex index {index_ptr, git_index_free}; @@ -288,7 +288,7 @@ ConversationRepositoryTest::addCommit(git_repository* repo, git_tree* tree_ptr = nullptr; if (git_tree_lookup(&tree_ptr, repo, &tree_id) < 0) { - JAMI_ERR("Could not look up initial tree"); + JAMI_ERR("Unable to look up initial tree"); return {}; } GitTree tree = {tree_ptr, git_tree_free}; @@ -310,7 +310,7 @@ ConversationRepositoryTest::addCommit(git_repository* repo, 1, &head_ref[0]) < 0) { - JAMI_ERR("Could not create commit buffer"); + JAMI_ERR("Unable to create commit buffer"); return {}; } @@ -324,7 +324,7 @@ ConversationRepositoryTest::addCommit(git_repository* repo, signed_str.c_str(), "signature") < 0) { - JAMI_ERR("Could not sign commit"); + JAMI_ERR("Unable to sign commit"); return {}; } @@ -336,7 +336,7 @@ ConversationRepositoryTest::addCommit(git_repository* repo, std::string branch_name = "refs/heads/" + branch; if (git_reference_create(&ref_ptr, repo, branch_name.c_str(), &commit_id, true, nullptr) < 0) { - JAMI_WARN("Could not move commit to main"); + JAMI_WARN("Unable to move commit to main"); } git_reference_free(ref_ptr); } diff --git a/test/unitTest/syncHistory/syncHistory.cpp b/test/unitTest/syncHistory/syncHistory.cpp index 410f8ddd0fe34498542bb1fd3e204fe69a7813ad..d20d458d597a0687aaf91b1c721d23bff343f49f 100644 --- a/test/unitTest/syncHistory/syncHistory.cpp +++ b/test/unitTest/syncHistory/syncHistory.cpp @@ -586,7 +586,7 @@ SyncHistoryTest::testSyncCreateAccountExportDeleteReimportOldBackup() alice2Id = Manager::instance().addAccount(details); CPPUNIT_ASSERT(cv.wait_for(lk, 30s, [&] { return alice2Data.deviceAnnounced; })); - // This will trigger a conversation request. Cause alice2 can't know first conversation + // This will trigger a conversation request. Cause alice2 is unable to know of first conversation libjami::sendMessage(bobId, convId, std::string("hi"), ""); CPPUNIT_ASSERT(cv.wait_for(lk, 30s, [&] { return alice2Data.requestReceived; })); diff --git a/tools/asterisk/extensions.conf b/tools/asterisk/extensions.conf index d750f6dc0313d3b73c0909f6092da33838cce2b6..ed724ea105b9b4d234a14c6d9c8a82a52c93fa3d 100644 --- a/tools/asterisk/extensions.conf +++ b/tools/asterisk/extensions.conf @@ -589,7 +589,7 @@ exten => i,1,Playback(invalid) ; "That's not valid, try again" ; exten => 500,1,Playback(demo-abouttotry); Let them know what's going on exten => 500,n,Dial(IAX2/guest@pbx.digium.com/s@default) ; Call the Asterisk demo -exten => 500,n,Playback(demo-nogo) ; Couldn't connect to the demo site +exten => 500,n,Playback(demo-nogo) ; Unable to connect to the demo site exten => 500,n,Goto(s,6) ; Return to the start over message. ; diff --git a/tools/asterisk/sip.conf b/tools/asterisk/sip.conf index b1dbe4e9c6a69aa9db670ea21c46fb27546a0e2f..9140cc38919ade558848c027832dfebfef1f6028 100644 --- a/tools/asterisk/sip.conf +++ b/tools/asterisk/sip.conf @@ -797,7 +797,7 @@ tlscertfile=/etc/asterisk/keys/asterisk.pem ; Certificate file (*.pem format onl ; ; The IP address used for media (audio, video, and text) in the SDP can also be overridden by using ; the media_address configuration option. This is only applicable to the general section and -; can not be set per-user or per-peer. +; is unable to be set per-user or per-peer. ; ; media_address = 172.16.42.1 ; @@ -858,7 +858,7 @@ tlscertfile=/etc/asterisk/keys/asterisk.pem ; Certificate file (*.pem format onl ;directmediapermit=172.16.0.0/16; which peers should be able to pass directmedia to each other ; (There is no default setting, this is just an example) ; Use this if some of your phones are on IP addresses that - ; can not reach each other directly. This way you can force + ; is unable to reach each other directly. This way you can force ; RTP to always flow through asterisk in such cases. ;ignoresdpversion=yes ; By default, Asterisk will honor the session version @@ -966,7 +966,7 @@ tlscertfile=/etc/asterisk/keys/asterisk.pem ; Certificate file (*.pem format onl ; jbenable = yes ; Enables the use of a jitterbuffer on the receiving side of a ; SIP channel. Defaults to "no". An enabled jitterbuffer will ; be used only if the sending side can create and the receiving - ; side can not accept jitter. The SIP channel can accept jitter, + ; side is unable to accept jitter. The SIP channel can accept jitter, ; thus a jitterbuffer on the receive SIP side will be used only ; if it is forced and enabled. @@ -1110,7 +1110,7 @@ tlscertfile=/etc/asterisk/keys/asterisk.pem ; Certificate file (*.pem format onl ;[sip_proxy] ; For incoming calls only. Example: FWD (Free World Dialup) ; We match on IP address of the proxy for incoming calls -; since we can not match on username (caller id) +; since we are unable to match on username (caller id) ;type=peer ;context=from-fwd ;host=fwd.pulver.com diff --git a/tools/cpplint.py3 b/tools/cpplint.py3 index 27ee1b711af1f3fb4da80af5d6403178f099db57..1dc2bd9d2151bdf9f673045ea6a5a77711a6878a 100755 --- a/tools/cpplint.py3 +++ b/tools/cpplint.py3 @@ -153,7 +153,7 @@ Syntax: cpplint.py [--verbose=#] [--output=vs7] [--filter=-x,+y,...] through --filter command-line flag. "exclude_files" allows to specify a regular expression to be matched against - a file name. If the expression matches, the file is skipped and not run + a filename. If the expression matches, the file is skipped and not run through liner. "linelength" allows to specify the allowed line length for the project. @@ -411,7 +411,7 @@ _UNAPPROVED_CPP11_HEADERS = frozenset([ # These headers are excluded from [build/include] and [build/include_order] # checks: -# - Anything not following google file name conventions (containing an +# - Anything not following google filename conventions (containing an # uppercase character, such as Python.h or nsStringAPI.h, for example). # - Lua headers. _THIRD_PARTY_HEADERS_PATTERN = re.compile( @@ -515,7 +515,7 @@ _root = None # This is set by --linelength flag. _line_length = 80 -# The allowed extensions for file names +# The allowed extensions for filenames # This is set by --extensions flag. _valid_extensions = set(['cc', 'h', 'cpp', 'cu', 'cuh']) @@ -635,7 +635,7 @@ class _IncludeState(object): _OTHER_HEADER: 'other header', } _SECTION_NAMES = { - _INITIAL_SECTION: "... nothing. (This can't be an error.)", + _INITIAL_SECTION: "... nothing. (This is not an error.)", _MY_H_SECTION: 'a header this file implements', _C_SECTION: 'C system header', _CPP_SECTION: 'C++ system header', @@ -1286,7 +1286,7 @@ def RemoveMultiLineComments(filename, lines, error): lineix_end = FindNextMultiLineCommentEnd(lines, lineix_begin) if lineix_end >= len(lines): error(filename, lineix_begin + 1, 'readability/multiline_comment', 5, - 'Could not find end of multi-line comment') + 'Unable to find end of multi-line comment') return RemoveMultiLineCommentsFromRange(lines, lineix_begin, lineix_end + 1) lineix = lineix_end + 1 @@ -1858,7 +1858,7 @@ def CheckForNewlineAtEOF(filename, lines, error): # last-but-two element of lines() exists and is empty. if len(lines) < 3 or lines[-2]: error(filename, len(lines) - 2, 'whitespace/ending_newline', 5, - 'Could not find a newline character at the end of the file.') + 'Unable to find a newline character at the end of the file.') def CheckForMultilineCommentsAndStrings(filename, clean_lines, linenum, error): @@ -2326,7 +2326,7 @@ class NestingState(object): pos = 0 continue - # We can't be sure if we just find a single '<', and need to + # We are unsure if we just find a single '<', and need to # find the matching '>'. (_, end_line, end_pos) = CloseExpression(clean_lines, linenum, pos - 1) if end_pos < 0: @@ -4715,7 +4715,7 @@ def _GetTextInside(text, start_pattern): the text. Returns: The extracted text. - None if either the opening string or ending punctuation could not be found. + None if either the opening string or ending punctuation are unable to be found. """ # TODO(unknown): Audit cpplint.py to see what places could be profitably # rewritten to use _GetTextInside (and use inferior regexp matching today). @@ -4971,7 +4971,7 @@ def CheckGlobalStatic(filename, clean_lines, linenum, error): # string Class<Type>::Method(... # # - Operators. These are matched separately because operator names - # cross non-word boundaries, and trying to match both operators + # cross non-word boundaries, and attempting to match both operators # and functions at the same time would decrease accuracy of # matching identifiers. # string Class::operator*() @@ -5683,10 +5683,10 @@ def CheckForIncludeWhatYouUse(filename, clean_lines, include_state, error, # For Emacs's flymake. # If cpplint is invoked from Emacs's flymake, a temporary file is generated - # by flymake and that file name might end with '_flymake.cc'. In that case, - # restore original file name here so that the corresponding header file can be + # by flymake and that filename might end with '_flymake.cc'. In that case, + # restore original filename here so that the corresponding header file can be # found. - # e.g. If the file name is 'foo_flymake.cc', we should search for 'foo.h' + # e.g. If the filename is 'foo_flymake.cc', we should search for 'foo.h' # instead of 'foo_flymake.h' abs_filename = re.sub(r'_flymake\.cc$', '.cc', abs_filename) @@ -5810,7 +5810,7 @@ def CheckRedundantVirtual(filename, clean_lines, linenum, error): start_col = 0 if end_col < 0: - return # Couldn't find end of parameter list, give up + return # Unable to find end of parameter list, give up # Look for "override" or "final" after the parameter list # (possibly on the next few lines). @@ -6095,7 +6095,7 @@ def ProcessConfigOverrides(filename): cfg_filters.append(val) elif name == 'exclude_files': # When matching exclude_files pattern, use the base_name of - # the current file name or the directory name we are processing. + # the current filename or the directory name we are processing. # For example, if we are checking for lint errors in /foo/bar/baz.cc # and we found the .cfg file at /foo/CPPLINT.cfg, then the config # file's "exclude_files" filter is meant to be checked against "bar" @@ -6121,7 +6121,7 @@ def ProcessConfigOverrides(filename): except IOError: sys.stderr.write( - "Skipping config file '%s': Can't open for reading\n" % cfg_file) + "Skipping config file '%s': Unable to open for reading\n" % cfg_file) keep_looking = False # Apply all the accumulated filters in reverse order (top-level directory @@ -6182,7 +6182,7 @@ def ProcessFile(filename, vlevel, extra_check_functions=[]): except IOError: sys.stderr.write( - "Skipping input '%s': Can't open for reading\n" % filename) + "Skipping input '%s': Unable to open for reading\n" % filename) _RestoreFilters() return @@ -6192,7 +6192,7 @@ def ProcessFile(filename, vlevel, extra_check_functions=[]): # When reading from stdin, the extension is unknown, so no cpplint tests # should rely on the extension. if filename != '-' and file_extension not in _valid_extensions: - sys.stderr.write('Ignoring %s; not a valid file name ' + sys.stderr.write('Ignoring %s; not a valid filename ' '(%s)\n' % (filename, ', '.join(_valid_extensions))) else: ProcessFileData(filename, file_extension, lines, Error, @@ -6205,7 +6205,7 @@ def ProcessFile(filename, vlevel, extra_check_functions=[]): # since critique can handle these just fine, and the style guide # doesn't dictate a particular end of line sequence. # - # We can't depend on os.linesep to determine what the desired + # We are unable to depend on os.linesep to determine what the desired # end-of-line sequence should be, since that will return the # server-side end-of-line sequence. if lf_lines and crlf_lines: diff --git a/tools/jamictrl/controller.py b/tools/jamictrl/controller.py index cff1ac9ef6afbc0f7662075a246e7383d239c40e..dbe59e34413b4ea83a123b942f97faece165d951 100644 --- a/tools/jamictrl/controller.py +++ b/tools/jamictrl/controller.py @@ -540,12 +540,12 @@ class libjamiCtrl(Thread): return [str(x) for x in self.callmanager.getConferenceList()] def getCallDetails(self, callid): - """Return informations on this call if exists""" + """Return information on this call if exists""" return self.callmanager.getCallDetails(callid) def getConferenceDetails(self, confid): - """Return informations on this conference if exists""" + """Return information on this conference if exists""" return self.callmanager.getConferenceDetails(confid) @@ -572,7 +572,7 @@ class libjamiCtrl(Thread): self.setFirstRegisteredAccount() if self.account != "IP2IP" and not self.isAccountRegistered(): - raise libjamiCtrlAccountError("Can't place a call without a registered account") + raise libjamiCtrlAccountError("Unable to place a call without a registered account") # Send the request to the CallManager callid = self.callmanager.placeCall(self.account, dest) @@ -622,7 +622,7 @@ class libjamiCtrl(Thread): self.setFirstRegisteredAccount() if not self.isAccountRegistered(): - raise libjamiCtrlAccountError("Can't accept a call without a registered account") + raise libjamiCtrlAccountError("Unable to accept a call without a registered account") if callid is None or callid == "": raise libjamiCtrlError("Invalid callID") diff --git a/tools/jamictrl/sippwrap.py b/tools/jamictrl/sippwrap.py index 3ef946945e083fbb7b254763d767736211eedf64..0477d710aa0f118a29914e58f395e36f696cae2f 100644 --- a/tools/jamictrl/sippwrap.py +++ b/tools/jamictrl/sippwrap.py @@ -51,7 +51,7 @@ class SippWrapper: if not self.remotePort and not self.remoteServer: self.isUserAgentClient = False elif self.remotePort and not self.remoteServer: - print "Error cannot have remote port specified with no server" + print "Error: Unable to have remote port specified with no server" return if self.remoteServer: @@ -130,7 +130,7 @@ class SippScreenStatParser: # TODO: Find a better way to determine which line to consider if "Failed call" not in self.logfile[40]: - print "Error: Could not find 'Failed call' statistics" + print "Error: Unable to find 'Failed call' statistics" # We consider this as a failure return True @@ -142,7 +142,7 @@ class SippScreenStatParser: # TODO: Find a better way to determine which line to consider if "Successful call" not in self.logfile[39]: - print "Error: Could not find 'Successful call' statistics" + print "Error: Unable to find 'Successful call' statistics" return False return "1" in self.logfile[39]