1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Remove pointless or potentially sensitive log messages

This commit is contained in:
tux3 2015-05-11 16:06:12 +02:00
parent f5f73539b2
commit ef688f6097
No known key found for this signature in database
GPG Key ID: 7E086DD661263264
4 changed files with 5 additions and 11 deletions

View File

@ -527,7 +527,6 @@ void Core::onGroupNamelistChange(Tox*, int groupnumber, int peernumber, uint8_t
void Core::onGroupTitleChange(Tox*, int groupnumber, int peernumber, const uint8_t* title, uint8_t len, void* _core) void Core::onGroupTitleChange(Tox*, int groupnumber, int peernumber, const uint8_t* title, uint8_t len, void* _core)
{ {
qDebug() << "group" << groupnumber << "title changed by" << peernumber;
Core* core = static_cast<Core*>(_core); Core* core = static_cast<Core*>(_core);
QString author; QString author;
if (peernumber >= 0) if (peernumber >= 0)
@ -573,17 +572,18 @@ void Core::requestFriendship(const QString& friendAddress, const QString& messag
} }
else else
{ {
qDebug() << "requesting friendship of "+friendAddress;
CString cMessage(message); CString cMessage(message);
uint32_t friendId = tox_friend_add(tox, CFriendAddress(friendAddress).data(), uint32_t friendId = tox_friend_add(tox, CFriendAddress(friendAddress).data(),
cMessage.data(), cMessage.size(), nullptr); cMessage.data(), cMessage.size(), nullptr);
if (friendId == std::numeric_limits<uint32_t>::max()) if (friendId == std::numeric_limits<uint32_t>::max())
{ {
qDebug() << "Failed to request friendship";
emit failedToAddFriend(userId); emit failedToAddFriend(userId);
} }
else else
{ {
qDebug() << "Requested friendship of "<<friendId;
// Update our friendAddresses // Update our friendAddresses
Settings::getInstance().updateFriendAdress(friendAddress); Settings::getInstance().updateFriendAdress(friendAddress);
QString inviteStr = tr("/me offers friendship."); QString inviteStr = tr("/me offers friendship.");
@ -1287,21 +1287,18 @@ QString Core::getPeerName(const ToxID& id) const
uint32_t friendId = tox_friend_by_public_key(tox, (uint8_t*)cid.data(), nullptr); uint32_t friendId = tox_friend_by_public_key(tox, (uint8_t*)cid.data(), nullptr);
if (friendId == std::numeric_limits<uint32_t>::max()) if (friendId == std::numeric_limits<uint32_t>::max())
{ {
qWarning() << "getPeerName: No such peer "+id.toString(); qWarning() << "getPeerName: No such peer";
return name; return name;
} }
const size_t nameSize = tox_friend_get_name_size(tox, friendId, nullptr); const size_t nameSize = tox_friend_get_name_size(tox, friendId, nullptr);
if (nameSize == SIZE_MAX) if (nameSize == SIZE_MAX)
{
//qDebug() << "getPeerName: Can't get name of friend "+QString().setNum(friendId)+" ("+id.toString()+")";
return name; return name;
}
uint8_t* cname = new uint8_t[nameSize<TOX_MAX_NAME_LENGTH ? TOX_MAX_NAME_LENGTH : nameSize]; uint8_t* cname = new uint8_t[nameSize<TOX_MAX_NAME_LENGTH ? TOX_MAX_NAME_LENGTH : nameSize];
if (tox_friend_get_name(tox, friendId, cname, nullptr) == false) if (tox_friend_get_name(tox, friendId, cname, nullptr) == false)
{ {
qWarning() << "getPeerName: Can't get name of friend "+QString().setNum(friendId)+" ("+id.toString()+")"; qWarning() << "getPeerName: Can't get name of friend "+QString().setNum(friendId);
delete[] cname; delete[] cname;
return name; return name;
} }

View File

@ -432,7 +432,7 @@ bool HistoryKeeper::removeHistory(int encrypted)
QList<HistoryKeeper::HistMessage> HistoryKeeper::exportMessagesDeleteFile(int encrypted) QList<HistoryKeeper::HistMessage> HistoryKeeper::exportMessagesDeleteFile(int encrypted)
{ {
auto msgs = getInstance()->exportMessages(); auto msgs = getInstance()->exportMessages();
qDebug() << "count" << msgs.size() << "messages exported"; qDebug() << "Messages exported";
if (!removeHistory(encrypted)) if (!removeHistory(encrypted))
qWarning() << "couldn't delete old log file!"; qWarning() << "couldn't delete old log file!";

View File

@ -87,7 +87,6 @@ bool EncryptedDb::pullFileContent(const QString &fname, QByteArray &buf)
while (!dbFile.atEnd()) while (!dbFile.atEnd())
{ {
QByteArray encrChunk = dbFile.read(encryptedChunkSize); QByteArray encrChunk = dbFile.read(encryptedChunkSize);
qDebug() << "pullFileContent: got chunk:" << encrChunk.size();
buf = Core::getInstance()->decryptData(encrChunk, Core::ptHistory); buf = Core::getInstance()->decryptData(encrChunk, Core::ptHistory);
if (buf.size() > 0) if (buf.size() > 0)
{ {

View File

@ -609,7 +609,6 @@ void Widget::reloadHistory()
void Widget::addFriend(int friendId, const QString &userId) void Widget::addFriend(int friendId, const QString &userId)
{ {
//qDebug() << "Adding friend with id" << userId;
ToxID userToxId = ToxID::fromString(userId); ToxID userToxId = ToxID::fromString(userId);
Friend* newfriend = FriendList::addFriend(friendId, userToxId); Friend* newfriend = FriendList::addFriend(friendId, userToxId);
contactListWidget->moveWidget(newfriend->getFriendWidget(),Status::Offline); contactListWidget->moveWidget(newfriend->getFriendWidget(),Status::Offline);
@ -654,7 +653,6 @@ void Widget::addFriend(int friendId, const QString &userId)
QPixmap avatar = Settings::getInstance().getSavedAvatar(userId); QPixmap avatar = Settings::getInstance().getSavedAvatar(userId);
if (!avatar.isNull()) if (!avatar.isNull())
{ {
//qWarning() << "loadded avatar for id" << userId;
newfriend->getChatForm()->onAvatarChange(friendId, avatar); newfriend->getChatForm()->onAvatarChange(friendId, avatar);
newfriend->getFriendWidget()->onAvatarChange(friendId, avatar); newfriend->getFriendWidget()->onAvatarChange(friendId, avatar);
} }