static void button_send_screenshot_update(BUTTON *b) { FRIEND *f = selected_item->data; if (f->online) { b->disabled = 0; button_setcolors_success(b); } else { b->disabled = 1; button_setcolors_disabled(b); } }
static void button_group_audio_update(BUTTON *b) { GROUPCHAT *g = selected_item->data; if (g->type == TOX_GROUPCHAT_TYPE_AV) { b->disabled = 0; if (g->audio_calling) button_setcolors_danger(b); else button_setcolors_success(b); } else { b->disabled = 1; button_setcolors_disabled(b); } }
static void button_chat_send_update(BUTTON *b) { if (selected_item->item == ITEM_FRIEND) { FRIEND *f = selected_item->data; if (f->online) { b->disabled = 0; button_setcolors_success(b); } else { b->disabled = 1; button_setcolors_disabled(b); } } else { b->disabled = 0; button_setcolors_success(b); } }
static void button_call_video_update(BUTTON *b) { FRIEND *f = selected_item->data; if (SELF_SEND_VIDEO(f->number)) { button_setcolors_danger(b); b->disabled = 0; } else if (FRIEND_SENDING_VIDEO(f->number)) { button_setcolors_warning(b); b->disabled = 0; } else { if (f->online) { button_setcolors_success(b); b->disabled = 0; } else { button_setcolors_disabled(b); b->disabled = 1; } } }
static void button_call_audio_update(BUTTON *b) { FRIEND *f = selected_item->data; if (UTOX_SENDING_AUDIO(f->number)) { button_setcolors_danger(b); b->disabled = 0; } else if (UTOX_AVAILABLE_AUDIO(f->number)) { button_setcolors_warning(b); b->disabled = 0; } else { if (f->online) { button_setcolors_success(b); b->disabled = 0; } else { button_setcolors_disabled(b); b->disabled = 1; } } }
static void button_group_audio_update(BUTTON *b) { GROUPCHAT *g = flist_get_groupchat(); if (!g) { LOG_ERR("Group", "Could not get selected groupchat."); return; } if (g->av_group) { b->disabled = false; if (g->active_call) { button_setcolors_danger(b); } else { button_setcolors_success(b); } } else { b->disabled = true; button_setcolors_disabled(b); } }