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

fix bug, fix actions to be like irc, and a disabled feature for future

This commit is contained in:
dubslow 2014-10-20 06:34:17 -05:00
parent 30e2afcc92
commit aa55dcae1e
4 changed files with 17 additions and 11 deletions

View File

@ -174,7 +174,7 @@ void GenericChatForm::addMessage(QString author, QString message, bool isAction,
QString date = datetime.toString(Settings::getInstance().getTimestampFormat());
bool isMe = (author == Widget::getInstance()->getUsername());
if (!isAction && message.startsWith("/me "))
if (!isAction && message.startsWith("/me"))
{ // always render actions regardless of what core thinks
isAction = true;
message = message.right(message.length()-4);

View File

@ -15,11 +15,11 @@
*/
#include "actionaction.h"
#include <QDebug>
ActionAction::ActionAction(const QString &author, QString message, const QString &date, const bool& me) :
MessageAction(author, message, date, me)
MessageAction(author, author+" "+message, date, me)
{
message = name + " " + message;
}
void ActionAction::setup(QTextCursor cursor, QTextEdit *)

View File

@ -778,17 +778,23 @@ void Widget::onGroupNamelistChanged(int groupnumber, int peernumber, uint8_t Cha
g = createGroup(groupnumber);
}
QString name = core->getGroupPeerName(groupnumber, peernumber);
TOX_CHAT_CHANGE change = static_cast<TOX_CHAT_CHANGE>(Change);
if (change == TOX_CHAT_CHANGE_PEER_ADD)
{
QString name = core->getGroupPeerName(groupnumber, peernumber);
if (name.isEmpty())
name = tr("<Unknown>", "Placeholder when we don't know someone's name in a group chat");
g->addPeer(peernumber,name);
//g->chatForm->addSystemInfoMessage(tr("%1 has joined the chat").arg(name), "green");
// we can't display these messages until irungentoo fixes peernumbers
// https://github.com/irungentoo/toxcore/issues/1128
}
else if (change == TOX_CHAT_CHANGE_PEER_DEL)
{
g->removePeer(peernumber);
else if (change == TOX_CHAT_CHANGE_PEER_NAME)
//g->chatForm->addSystemInfoMessage(tr("%1 has left the chat").arg(name), "silver");
}
else if (change == TOX_CHAT_CHANGE_PEER_NAME) // core overwrites old name before telling us it changed...
g->updatePeer(peernumber,core->getGroupPeerName(groupnumber, peernumber));
}

View File

@ -38,8 +38,8 @@ span.quote {
}
div.green {
margin-top: 12px;
margin-bottom: 12px;
margin-top: 6px;
margin-bottom: 6px;
margin-left: 0px;
margin-right: 0px;
color: @white;
@ -48,8 +48,8 @@ div.green {
}
div.silver {
margin-top: 12px;
margin-bottom: 12px;
margin-top: 6px;
margin-bottom: 6px;
margin-left: 0px;
margin-right: 0px;
color: @black;
@ -58,8 +58,8 @@ div.silver {
}
div.red {
margin-top: 12px;
margin-bottom: 12px;
margin-top: 6px;
margin-bottom: 6px;
margin-left: 0px;
margin-right: 0px;
color: @white;