diff --git a/daemon/src/history/history.cpp b/daemon/src/history/history.cpp index a84b2128c0bd1d39df126a3c43ef41de7574dc5f..caa95b663ec191d44b3c8cc9d8872e7af3ea9f71 100644 --- a/daemon/src/history/history.cpp +++ b/daemon/src/history/history.cpp @@ -89,10 +89,8 @@ bool History::save() void History::addEntry(const HistoryItem &item, int oldest) { - if (item.hasPeerNumber() and item.youngerThan(oldest)) { - DEBUG("Adding history item"); + if (item.hasPeerNumber() and item.youngerThan(oldest)) items_.push_back(item); - } } void History::ensurePath() diff --git a/daemon/src/history/historyitem.cpp b/daemon/src/history/historyitem.cpp index cfcc1c461a6a95a8209054f59a6f38466c165f33..57799b276a453b839bd2dd9c54adb23bac9db293 100644 --- a/daemon/src/history/historyitem.cpp +++ b/daemon/src/history/historyitem.cpp @@ -57,14 +57,14 @@ HistoryItem::HistoryItem(const map<string, string> &args) : entryMap_(args), HistoryItem::HistoryItem(std::istream &entry) : entryMap_(), timestampStart_(0) { - std::string tmp; + string tmp; while (std::getline(entry, tmp, '\n')) { size_t pos = tmp.find('='); - if (pos == std::string::npos) + if (pos == string::npos) break; else if (pos < tmp.length() - 1) { - std::string key(tmp.substr(0, pos)); - std::string val(tmp.substr(pos + 1, tmp.length() - pos - 1)); + string key(tmp.substr(0, pos)); + string val(tmp.substr(pos + 1, tmp.length() - pos - 1)); entryMap_[key] = val; } } diff --git a/daemon/src/managerimpl.cpp b/daemon/src/managerimpl.cpp index aa6d23e2f45731e3fd402f779c973070a1faddcf..517581241368a9e745d3e2532fb054a79c4c435e 100644 --- a/daemon/src/managerimpl.cpp +++ b/daemon/src/managerimpl.cpp @@ -1384,10 +1384,11 @@ void ManagerImpl::incomingCall(Call* call, const std::string& accountId) // when placing new call from history (if call is IAX, do nothing) std::string peerNumber(call->getPeerNumber()); - size_t startIndex = peerNumber.find("sip:"); + const char SIP_PREFIX[] = "sip:"; + size_t startIndex = peerNumber.find(SIP_PREFIX); if (startIndex != std::string::npos) - call->setPeerNumber(peerNumber.substr(startIndex + 4)); + call->setPeerNumber(peerNumber.substr(startIndex + sizeof(SIP_PREFIX) - 1)); } if (not hasCurrentCall()) { @@ -1397,14 +1398,9 @@ void ManagerImpl::incomingCall(Call* call, const std::string& accountId) addWaitingCall(call->getCallId()); - std::string from(call->getDisplayName()); std::string number(call->getPeerNumber()); - if (not from.empty() and not number.empty()) - from += " "; - - from += "<" + number + ">"; - + std::string from("<" + number + ">"); dbus_.getCallManager()->incomingCall(accountId, call->getCallId(), call->getDisplayName() + " " + from); } diff --git a/daemon/src/sip/sipvoiplink.cpp b/daemon/src/sip/sipvoiplink.cpp index 5f556403f33bc2f3c65a15a4e62510990f361e55..6d370dc8cb582642b0e43004d4358fbdcb391d1c 100644 --- a/daemon/src/sip/sipvoiplink.cpp +++ b/daemon/src/sip/sipvoiplink.cpp @@ -1263,7 +1263,6 @@ void SIPVoIPLink::findLocalAddressFromUri(const std::string& uri, pjsip_transpor namespace { std::string parseDisplayName(const char * buffer) { - // Parse the display name from "From" header const char* from_header = strstr(buffer, "From: "); if (!from_header) diff --git a/gnome/src/contacts/calltree.c b/gnome/src/contacts/calltree.c index 341a16c10bd94eb11442c0832e9dffc44d3d77ae..33f76cacbd4f9136d755f79be898d2847503083a 100644 --- a/gnome/src/contacts/calltree.c +++ b/gnome/src/contacts/calltree.c @@ -33,7 +33,6 @@ #include "calllist.h" #include "calltree.h" #include <stdlib.h> -#include <glib/gprintf.h> #include "eel-gconf-extensions.h" #include "unused.h"