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:
parent
30e2afcc92
commit
aa55dcae1e
@ -174,7 +174,7 @@ void GenericChatForm::addMessage(QString author, QString message, bool isAction,
|
|||||||
QString date = datetime.toString(Settings::getInstance().getTimestampFormat());
|
QString date = datetime.toString(Settings::getInstance().getTimestampFormat());
|
||||||
bool isMe = (author == Widget::getInstance()->getUsername());
|
bool isMe = (author == Widget::getInstance()->getUsername());
|
||||||
|
|
||||||
if (!isAction && message.startsWith("/me "))
|
if (!isAction && message.startsWith("/me"))
|
||||||
{ // always render actions regardless of what core thinks
|
{ // always render actions regardless of what core thinks
|
||||||
isAction = true;
|
isAction = true;
|
||||||
message = message.right(message.length()-4);
|
message = message.right(message.length()-4);
|
||||||
|
@ -15,11 +15,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "actionaction.h"
|
#include "actionaction.h"
|
||||||
|
#include <QDebug>
|
||||||
|
|
||||||
ActionAction::ActionAction(const QString &author, QString message, const QString &date, const bool& me) :
|
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 *)
|
void ActionAction::setup(QTextCursor cursor, QTextEdit *)
|
||||||
|
@ -778,17 +778,23 @@ void Widget::onGroupNamelistChanged(int groupnumber, int peernumber, uint8_t Cha
|
|||||||
g = createGroup(groupnumber);
|
g = createGroup(groupnumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString name = core->getGroupPeerName(groupnumber, peernumber);
|
||||||
TOX_CHAT_CHANGE change = static_cast<TOX_CHAT_CHANGE>(Change);
|
TOX_CHAT_CHANGE change = static_cast<TOX_CHAT_CHANGE>(Change);
|
||||||
if (change == TOX_CHAT_CHANGE_PEER_ADD)
|
if (change == TOX_CHAT_CHANGE_PEER_ADD)
|
||||||
{
|
{
|
||||||
QString name = core->getGroupPeerName(groupnumber, peernumber);
|
|
||||||
if (name.isEmpty())
|
if (name.isEmpty())
|
||||||
name = tr("<Unknown>", "Placeholder when we don't know someone's name in a group chat");
|
name = tr("<Unknown>", "Placeholder when we don't know someone's name in a group chat");
|
||||||
g->addPeer(peernumber,name);
|
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)
|
else if (change == TOX_CHAT_CHANGE_PEER_DEL)
|
||||||
|
{
|
||||||
g->removePeer(peernumber);
|
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));
|
g->updatePeer(peernumber,core->getGroupPeerName(groupnumber, peernumber));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,8 +38,8 @@ span.quote {
|
|||||||
}
|
}
|
||||||
|
|
||||||
div.green {
|
div.green {
|
||||||
margin-top: 12px;
|
margin-top: 6px;
|
||||||
margin-bottom: 12px;
|
margin-bottom: 6px;
|
||||||
margin-left: 0px;
|
margin-left: 0px;
|
||||||
margin-right: 0px;
|
margin-right: 0px;
|
||||||
color: @white;
|
color: @white;
|
||||||
@ -48,8 +48,8 @@ div.green {
|
|||||||
}
|
}
|
||||||
|
|
||||||
div.silver {
|
div.silver {
|
||||||
margin-top: 12px;
|
margin-top: 6px;
|
||||||
margin-bottom: 12px;
|
margin-bottom: 6px;
|
||||||
margin-left: 0px;
|
margin-left: 0px;
|
||||||
margin-right: 0px;
|
margin-right: 0px;
|
||||||
color: @black;
|
color: @black;
|
||||||
@ -58,8 +58,8 @@ div.silver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
div.red {
|
div.red {
|
||||||
margin-top: 12px;
|
margin-top: 6px;
|
||||||
margin-bottom: 12px;
|
margin-bottom: 6px;
|
||||||
margin-left: 0px;
|
margin-left: 0px;
|
||||||
margin-right: 0px;
|
margin-right: 0px;
|
||||||
color: @white;
|
color: @white;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user