Example #1
0
/*
 * buttonCancelClick
 */
void guiMessage::buttonCancelClick(wxCommandEvent& event) {

    // This button becomes the reply button in the case of a loaded message
    if(_messageLoaded) {
        messageReply();
    } else {
        if( _message && _cleanup) {
            delete _message;
            _message = 0;
        }
    	Destroy();
    }
}
void ConversationModel::sendMessage(const QString &text)
{
    if (text.isEmpty())
        return;

    ChatMessageCommand *command = new ChatMessageCommand;
    connect(command, SIGNAL(commandFinished()), this, SLOT(messageReply()));
    command->send(m_contact->conn(), QDateTime::currentDateTime(), text, lastReceivedId);

    beginInsertRows(QModelIndex(), 0, 0);
    MessageData message = { text, QDateTime::currentDateTime(), command->identifier(), Sending };
    messages.prepend(message);
    endInsertRows();
}