Browse Source

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

pull/488/head
dubslow 11 years ago
parent
commit
aa55dcae1e
  1. 2
      src/widget/form/genericchatform.cpp
  2. 4
      src/widget/tool/chatactions/actionaction.cpp
  3. 10
      src/widget/widget.cpp
  4. 12
      ui/chatArea/innerStyle.css

2
src/widget/form/genericchatform.cpp

@ -174,7 +174,7 @@ void GenericChatForm::addMessage(QString author, QString message, bool isAction, @@ -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);

4
src/widget/tool/chatactions/actionaction.cpp

@ -15,11 +15,11 @@ @@ -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 *)

10
src/widget/widget.cpp

@ -778,17 +778,23 @@ void Widget::onGroupNamelistChanged(int groupnumber, int peernumber, uint8_t Cha @@ -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));
}

12
ui/chatArea/innerStyle.css

@ -38,8 +38,8 @@ span.quote { @@ -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 { @@ -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 { @@ -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;

Loading…
Cancel
Save