Improve async distant chat, fix chat msg receiving

DistantChatService::initiateDistantChatConnexion(...) made notification
  message optional (enabled by default)
p3ChatService removed duplicion avoidance as it is not necessary
p3ChatService::sendStatusString(...) send status only if peer is online
protect p3ChatService::mDistantGxsMap with mutex as operation on it may
  be done by different threads
p3ChatService::receiveGxsMai(...) set chat message item peer id with
  distant tunnel id, so it is recognized as a distant message later
made p3GxsTunnelService::makeGxsTunnelId(...) static as it need no
  access to this, now it can be used easier by other components
rename RsGxsMailItem::recipientsHint to recipientHint as for now only
  one recipient is possible (TODO: update documentation too)
GxsMailsClient::receiveGxsMail(...) changed paramethers for better
  abstracion, now destination id is passed too because it is usually a
  very useful information
ChatWidget some adaptation to async chat, a couple of method have been
  deprecated too
PopupDistantChatDialog::updateDisplay(...) adapt message shown to the
  user to the new async chat paradigm (TODO: need review)
This commit is contained in:
Gioacchino Mazzurco 2017-03-01 23:07:53 +01:00
parent 0f1106fd8f
commit 953b70fbe4
14 changed files with 212 additions and 212 deletions

View file

@ -70,7 +70,7 @@
*****/
ChatWidget::ChatWidget(QWidget *parent) :
QWidget(parent), sendingBlocked(false), ui(new Ui::ChatWidget)
QWidget(parent), ui(new Ui::ChatWidget)
{
ui->setupUi(this);
@ -413,18 +413,9 @@ ChatWidget::ChatType ChatWidget::chatType()
return CHATTYPE_UNKNOWN;
}
void ChatWidget::blockSending(QString msg)
{
sendingBlocked = true;
ui->sendButton->setEnabled(false);
ui->sendButton->setToolTip(msg);
}
void ChatWidget::blockSending(QString msg) { ui->sendButton->setToolTip(msg); }
void ChatWidget::unblockSending()
{
sendingBlocked = false;
updateLenOfChatTextEdit();
}
void ChatWidget::unblockSending() { updateLenOfChatTextEdit(); }
void ChatWidget::processSettings(bool load)
{
@ -1096,8 +1087,6 @@ void ChatWidget::updateStatusTyping()
void ChatWidget::updateLenOfChatTextEdit()
{
if(sendingBlocked) return;
QTextEdit *chatWidget = ui->chatTextEdit;
QString text;
RsHtml::optimizeHtml(chatWidget, text);