From e7be84778444c5df00a05538a2f1d65a8d5fbf1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Andr=C3=A9=20Santoni?= Date: Sun, 5 Mar 2017 22:42:33 +0100 Subject: [PATCH] Avoid pushing netplay rooms on wrong tabs --- menu/cbs/menu_cbs_ok.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c index 25012f2514..f11e625301 100644 --- a/menu/cbs/menu_cbs_ok.c +++ b/menu/cbs/menu_cbs_ok.c @@ -3400,10 +3400,22 @@ static int action_ok_push_scan_file(const char *path, static void netplay_refresh_rooms_cb(void *task_data, void *user_data, const char *err) { char buf[PATH_MAX_LENGTH]; + const char *path = NULL; + const char *label = NULL; + unsigned menu_type = 0; + enum msg_hash_enums enum_idx = MSG_UNKNOWN; + http_transfer_data_t *data = (http_transfer_data_t*)task_data; buf[0] = '\0'; + menu_entries_get_last_stack(&path, &label, &menu_type, &enum_idx, NULL); + + /* Don't push the results if we left the netplay menu */ + if (!string_is_equal(label, + msg_hash_to_str(MENU_ENUM_LABEL_NETPLAY_TAB))) + return; + if (!data || err) goto finish;