From 755a5677a261a42a2110bcd9587c7fd2f87aadca Mon Sep 17 00:00:00 2001 From: agilob Date: Sun, 2 Nov 2014 21:07:41 +0000 Subject: [PATCH] Call notifications --- src/widget/form/chatform.cpp | 8 +++++++- src/widget/form/genericchatform.cpp | 15 +++++++++------ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/widget/form/chatform.cpp b/src/widget/form/chatform.cpp index abceb9466..27852664f 100644 --- a/src/widget/form/chatform.cpp +++ b/src/widget/form/chatform.cpp @@ -226,6 +226,7 @@ void ChatForm::onAvInvite(int FriendId, int CallId, bool video) videoButton->style()->polish(videoButton); connect(callButton, SIGNAL(clicked()), this, SLOT(onAnswerCallTriggered())); } + addSystemInfoMessage(tr("%1 calling").arg(f->getName()), "white", QDateTime::currentDateTime()); Widget* w = Widget::getInstance(); if (!w->isFriendWidgetCurActiveWidget(f)|| w->isMinimized() || !w->isActiveWindow()) @@ -336,6 +337,7 @@ void ChatForm::onAvRinging(int FriendId, int CallId, bool video) videoButton->style()->polish(videoButton); connect(callButton, SIGNAL(clicked()), this, SLOT(onCancelCallTriggered())); } + addSystemInfoMessage(tr("%1 calling").arg(f->getName()), "white", QDateTime::currentDateTime()); } void ChatForm::onAvStarting(int FriendId, int CallId, bool video) @@ -386,7 +388,9 @@ void ChatForm::onAvEnding(int FriendId, int) videoButton->disconnect(); connect(callButton, SIGNAL(clicked()), this, SLOT(onCallTriggered())); connect(videoButton, SIGNAL(clicked()), this, SLOT(onVideoCallTriggered())); - + + addSystemInfoMessage(tr("Call with %1 ended").arg(f->getName()), "white", QDateTime::currentDateTime()); + netcam->hide(); } @@ -461,6 +465,8 @@ void ChatForm::onAvRejected(int FriendId, int) videoButton->disconnect(); connect(callButton, SIGNAL(clicked()), this, SLOT(onCallTriggered())); connect(videoButton, SIGNAL(clicked()), this, SLOT(onVideoCallTriggered())); + + addSystemInfoMessage(tr("Call rejected").arg(f->getName()), "white", QDateTime::currentDateTime()); netcam->hide(); } diff --git a/src/widget/form/genericchatform.cpp b/src/widget/form/genericchatform.cpp index df7c4c76a..d082b8551 100644 --- a/src/widget/form/genericchatform.cpp +++ b/src/widget/form/genericchatform.cpp @@ -192,8 +192,9 @@ void GenericChatForm::onSaveLogClicked() file.close(); } -/// THIS FUNCTION IS DEPRECATED -/// The only reason it's still alive is because the groupchat API is a bit limited +/** + * @deprecated The only reason it's still alive is because the groupchat API is a bit limited + */ void GenericChatForm::addMessage(const QString& author, const QString &message, bool isAction, const QDateTime &datetime) { ChatActionPtr ca = genMessageActionAction(author, message, isAction, datetime); @@ -212,8 +213,9 @@ void GenericChatForm::addSelfMessage(const QString &message, bool isAction, cons chatWidget->insertMessage(ca); } -/// THIS FUNCTION IS DEPRECATED -/// The only reason it's still alive is because the groupchat API is a bit limited +/** + * @deprecated The only reason it's still alive is because the groupchat API is a bit limited + */ void GenericChatForm::addAlertMessage(const QString& author, QString message, QDateTime datetime) { QString date = datetime.toString(Settings::getInstance().getTimestampFormat()); @@ -291,8 +293,9 @@ void GenericChatForm::clearChatArea(bool notinform) } } -/// THIS FUNCTION IS DEPRECATED -/// The only reason it's still alive is because the groupchat API is a bit limited +/** + * @deprecated The only reason it's still alive is because the groupchat API is a bit limited + */ ChatActionPtr GenericChatForm::genMessageActionAction(const QString &author, QString message, bool isAction, const QDateTime &datetime) { if (earliestMessage == nullptr)