Browse Source

Modified groupchat notifications

pull/13/head
Flynn 11 years ago
parent
commit
37abba17b8
  1. 1
      group.cpp
  2. 2
      group.h
  3. BIN
      img/status/dot_groupchat_newmessages.png
  4. BIN
      img/status/dot_groupchat_notification.png
  5. 8
      widget/widget.cpp

1
group.cpp

@ -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

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 605 B

BIN
img/status/dot_groupchat_notification.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 761 B

After

Width:  |  Height:  |  Size: 764 B

8
widget/widget.cpp

@ -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…
Cancel
Save