mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-02 18:43:30 +00:00
fix bug #21757
by fixing up bad commit eb9274bd4c78a5f9a86bc9e0bf748f701d81e6b1. the code to drop messages older than 5 should run inside the if block, in the scenario when there were previous message, not outside it (!)
This commit is contained in:
parent
6040bfbe8b
commit
6d460b9827
@ -922,23 +922,23 @@ void game_display::send_notification(const std::string& /*owner*/, const std::st
|
||||
|
||||
if (i != i_end) {
|
||||
i->message = message + "\n" + i->message;
|
||||
int endl_pos = 0;
|
||||
for (int ctr = 0; ctr < 5; ctr++)
|
||||
endl_pos = i->message.find('\n', endl_pos);
|
||||
|
||||
i->message = i->message.substr(0,endl_pos);
|
||||
|
||||
send_dbus_notification(connection, i->id, owner, i->message);
|
||||
return;
|
||||
} else {
|
||||
uint32_t id = send_dbus_notification(connection, 0, owner, message);
|
||||
if (!id) return;
|
||||
wnotify visual;
|
||||
visual.id = id;
|
||||
visual.owner = owner;
|
||||
visual.message = message;
|
||||
notifications.push_back(visual);
|
||||
}
|
||||
|
||||
int endl_pos = 0;
|
||||
for (int ctr = 0; ctr < 5; ctr++)
|
||||
endl_pos = i->message.find('\n', endl_pos);
|
||||
|
||||
i->message = i->message.substr(0,endl_pos);
|
||||
|
||||
uint32_t id = send_dbus_notification(connection, 0, owner, message);
|
||||
if (!id) return;
|
||||
wnotify visual;
|
||||
visual.id = id;
|
||||
visual.owner = owner;
|
||||
visual.message = message;
|
||||
notifications.push_back(visual);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GROWL
|
||||
|
Loading…
x
Reference in New Issue
Block a user