mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-26 16:03:27 +01:00
possibly fix sound notification bug
This commit is contained in:
parent
4e9f125e95
commit
be264528d2
@ -384,8 +384,7 @@ void dns3_lookup(ToxWindow *self, Tox *m, const char *id_bin, const char *addr,
|
||||
}
|
||||
|
||||
if (t_data.busy) {
|
||||
const char *err = "Please wait for previous user lookup to finish.";
|
||||
line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, err);
|
||||
line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Please wait for previous user lookup to finish.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
13
src/notify.c
13
src/notify.c
@ -101,7 +101,7 @@ struct _ActiveNotifications {
|
||||
size_t size;
|
||||
time_t n_timeout;
|
||||
#endif
|
||||
} actives[ACTIVE_NOTIFS_MAX] = {{0}};
|
||||
} actives[ACTIVE_NOTIFS_MAX];
|
||||
/**********************************************************************************/
|
||||
/**********************************************************************************/
|
||||
/**********************************************************************************/
|
||||
@ -209,7 +209,7 @@ void graceful_clear()
|
||||
}
|
||||
#endif
|
||||
|
||||
if(actives[i].id_indicator) *actives[i].id_indicator = -1; // reset indicator value
|
||||
*actives[i].id_indicator = -1; /* reset indicator value */
|
||||
|
||||
if ( actives[i].looping ) {
|
||||
stop_sound(i);
|
||||
@ -265,8 +265,7 @@ void* do_playing(void* _p)
|
||||
GError* ignore;
|
||||
notify_notification_close(actives[i].box, &ignore);
|
||||
actives[i].box = NULL;
|
||||
|
||||
if(actives[i].id_indicator) *actives[i].id_indicator = -1; // reset indicator value
|
||||
*actives[i].id_indicator = -1; /* reset indicator value */
|
||||
|
||||
if (!actives[i].looping && !is_playing(actives[i].source)) {
|
||||
/* stop source if not looping or playing, just terminate box */
|
||||
@ -323,8 +322,7 @@ void* do_playing(void* _p)
|
||||
GError* ignore;
|
||||
notify_notification_close(actives[i].box, &ignore);
|
||||
actives[i].box = NULL;
|
||||
|
||||
if(actives[i].id_indicator) *actives[i].id_indicator = -1; // reset indicator value
|
||||
*actives[i].id_indicator = -1; /* reset indicator value */
|
||||
memset(&actives[i], 0, sizeof(struct _ActiveNotifications));
|
||||
}
|
||||
}
|
||||
@ -346,7 +344,7 @@ void graceful_clear()
|
||||
actives[i].box = NULL;
|
||||
}
|
||||
|
||||
if(actives[i].id_indicator) *actives[i].id_indicator = -1; // reset indicator value
|
||||
*actives[i].id_indicator = -1; /* reset indicator value */
|
||||
memset(&actives[i], 0, sizeof(struct _ActiveNotifications));
|
||||
}
|
||||
|
||||
@ -520,7 +518,6 @@ int sound_notify(ToxWindow* self, Notification notif, uint64_t flags, int* id_in
|
||||
|
||||
if (self && (!self->stb || self->stb->status != TOX_USERSTATUS_BUSY) && user_settings->alerts == ALERTS_ENABLED)
|
||||
id = m_play_sound(notif, flags);
|
||||
|
||||
else if (flags & NT_ALWAYS)
|
||||
id = m_play_sound(notif, flags);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user