Beispiel #1
0
void ContactView::sendChatMessage()
{
  auto msg = ui->chat_input->toPlainText();
  if (msg.size() != 0)
  {
    auto                               app = bts::application::instance();
    auto                               profile = app->get_profile();
    auto                               idents = profile->identities();
    bts::bitchat::private_text_message text_msg(msg.toUtf8().constData() );
    if (idents.size() )
    {
      fc::ecc::private_key my_priv_key = profile->get_keychain().get_identity_key(idents[0].dac_id_string);
      app->send_text_message(text_msg, _current_contact.public_key, my_priv_key);
      appendChatMessage("me", msg);
    }

    ui->chat_input->setPlainText(QString());
  }
}
Beispiel #2
0
void
ChatDialog::receiveChatMessage(QString nick, QString text, time_t timestamp)
{
  appendChatMessage(nick, text, timestamp);
}
void ChatMessageModel::appendChatMessages(const QList<Message> &msgs)
{
    foreach (auto msg, msgs)
    {
        appendChatMessage(msg);
    }