mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-27 22:36:22 +00:00
Reduce timestamp call when saving last muc message
Let's test for mucwin earlier.
This commit is contained in:
@@ -273,7 +273,7 @@ sv_ev_room_history(const char *const room_jid, const char *const nick,
|
|||||||
GDateTime *timestamp, const char *const message)
|
GDateTime *timestamp, const char *const message)
|
||||||
{
|
{
|
||||||
ProfMucWin *mucwin = wins_get_muc(room_jid);
|
ProfMucWin *mucwin = wins_get_muc(room_jid);
|
||||||
|
if (mucwin) {
|
||||||
// if this is the first successful connection
|
// if this is the first successful connection
|
||||||
if (_success_connections_counter == 1) {
|
if (_success_connections_counter == 1) {
|
||||||
// save timestamp of last received muc message
|
// save timestamp of last received muc message
|
||||||
@@ -285,9 +285,10 @@ sv_ev_room_history(const char *const room_jid, const char *const nick,
|
|||||||
}
|
}
|
||||||
|
|
||||||
gboolean younger = g_date_time_compare(_last_muc_message, timestamp) < 0 ? TRUE : FALSE;
|
gboolean younger = g_date_time_compare(_last_muc_message, timestamp) < 0 ? TRUE : FALSE;
|
||||||
if (mucwin && (_success_connections_counter == 1 || younger )) {
|
if (_success_connections_counter == 1 || younger ) {
|
||||||
mucwin_history(mucwin, nick, timestamp, message);
|
mucwin_history(mucwin, nick, timestamp, message);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
Reference in New Issue
Block a user