mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Modified groupchat notifications
This commit is contained in:
parent
d09926ebf0
commit
37abba17b8
@ -19,6 +19,7 @@ Group::Group(int GroupId, QString Name)
|
|||||||
|
|
||||||
//in groupchats, we only notify on messages containing your name
|
//in groupchats, we only notify on messages containing your name
|
||||||
hasNewMessages = 0;
|
hasNewMessages = 0;
|
||||||
|
userWasMentioned = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Group::~Group()
|
Group::~Group()
|
||||||
|
2
group.h
2
group.h
@ -32,7 +32,7 @@ public:
|
|||||||
GroupChatForm* chatForm;
|
GroupChatForm* chatForm;
|
||||||
bool hasPeerInfo;
|
bool hasPeerInfo;
|
||||||
QTimer peerInfoTimer;
|
QTimer peerInfoTimer;
|
||||||
int hasNewMessages;
|
int hasNewMessages, userWasMentioned;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // GROUP_H
|
#endif // GROUP_H
|
||||||
|
BIN
img/status/dot_groupchat_newmessages.png
Normal file
BIN
img/status/dot_groupchat_newmessages.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 605 B |
Binary file not shown.
Before Width: | Height: | Size: 761 B After Width: | Height: | Size: 764 B |
@ -430,8 +430,15 @@ void Widget::onGroupMessageReceived(int groupnumber, int friendgroupnumber, cons
|
|||||||
{
|
{
|
||||||
playMessageNotification();
|
playMessageNotification();
|
||||||
g->hasNewMessages = 1;
|
g->hasNewMessages = 1;
|
||||||
|
g->userWasMentioned = 1;
|
||||||
g->widget->statusPic.setPixmap(QPixmap("img/status/dot_groupchat_notification.png"));
|
g->widget->statusPic.setPixmap(QPixmap("img/status/dot_groupchat_notification.png"));
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
if (g->hasNewMessages == 0)
|
||||||
|
{
|
||||||
|
g->hasNewMessages = 1;
|
||||||
|
g->widget->statusPic.setPixmap(QPixmap("img/status/dot_groupchat_newmessages.png"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -473,6 +480,7 @@ void Widget::onGroupWidgetClicked(GroupWidget* widget)
|
|||||||
if (g->hasNewMessages != 0)
|
if (g->hasNewMessages != 0)
|
||||||
{
|
{
|
||||||
g->hasNewMessages = 0;
|
g->hasNewMessages = 0;
|
||||||
|
g->userWasMentioned = 0;
|
||||||
g->widget->statusPic.setPixmap(QPixmap("img/status/dot_groupchat.png"));
|
g->widget->statusPic.setPixmap(QPixmap("img/status/dot_groupchat.png"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user