diff --git a/src/plugins/relay/api/relay-api-msg.c b/src/plugins/relay/api/relay-api-msg.c index 95eb53617..56b184ab8 100644 --- a/src/plugins/relay/api/relay-api-msg.c +++ b/src/plugins/relay/api/relay-api-msg.c @@ -385,6 +385,7 @@ relay_api_msg_buffer_to_json (struct t_gui_buffer *buffer, lines = lines_free; MSG_ADD_STR_PTR("type", ptr_string); MSG_ADD_HDATA_STR_COLORS("title", "title"); + MSG_ADD_HDATA_STR_COLORS("input_prompt", "input_prompt"); MSG_ADD_HDATA_STR("input", "input_buffer"); MSG_ADD_HDATA_VAR(Number, "input_position", integer, "input_buffer_pos"); MSG_ADD_HDATA_VAR(Bool, "input_multiline", integer, "input_multiline"); diff --git a/src/plugins/relay/api/relay-api.c b/src/plugins/relay/api/relay-api.c index 990ff1425..34c7e14f0 100644 --- a/src/plugins/relay/api/relay-api.c +++ b/src/plugins/relay/api/relay-api.c @@ -126,7 +126,9 @@ relay_api_hook_signals (struct t_relay_client *client) if (!RELAY_API_DATA(client, hook_signal_input)) { RELAY_API_DATA(client, hook_signal_input) = - weechat_hook_signal ("input_text_changed;input_text_cursor_moved", + weechat_hook_signal ("input_prompt_changed;" + "input_text_changed;" + "input_text_cursor_moved", &relay_api_protocol_signal_input_cb, client, NULL); } diff --git a/tests/unit/plugins/relay/api/test-relay-api-protocol.cpp b/tests/unit/plugins/relay/api/test-relay-api-protocol.cpp index ac7eed8ed..3b68b347e 100644 --- a/tests/unit/plugins/relay/api/test-relay-api-protocol.cpp +++ b/tests/unit/plugins/relay/api/test-relay-api-protocol.cpp @@ -432,6 +432,7 @@ TEST(RelayApiProtocolWithClient, CbBuffers) WEE_CHECK_OBJ_NUM(1, json, "number"); WEE_CHECK_OBJ_STR("formatted", json, "type"); WEE_CHECK_OBJ_STRN("WeeChat", 7, json, "title"); + WEE_CHECK_OBJ_STR("", json, "input_prompt"); WEE_CHECK_OBJ_STR("", json, "input"); WEE_CHECK_OBJ_NUM(0, json, "input_position"); WEE_CHECK_OBJ_BOOL(0, json, "input_multiline"); @@ -442,6 +443,7 @@ TEST(RelayApiProtocolWithClient, CbBuffers) WEE_CHECK_OBJ_STR("weechat", json_var, "name"); /* get one buffer by name */ + gui_buffer_set (gui_buffers, "input_prompt", "test_prompt"); gui_buffer_set (gui_buffers, "input", "test"); gui_buffer_set (gui_buffers, "input_pos", "4"); gui_buffer_set (gui_buffers, "input_multiline", "1"); @@ -456,6 +458,7 @@ TEST(RelayApiProtocolWithClient, CbBuffers) WEE_CHECK_OBJ_NUM(1, json, "number"); WEE_CHECK_OBJ_STR("formatted", json, "type"); WEE_CHECK_OBJ_STRN("WeeChat", 7, json, "title"); + WEE_CHECK_OBJ_STR("test_prompt", json, "input_prompt"); WEE_CHECK_OBJ_STR("test", json, "input"); WEE_CHECK_OBJ_NUM(4, json, "input_position"); WEE_CHECK_OBJ_BOOL(1, json, "input_multiline"); @@ -464,6 +467,7 @@ TEST(RelayApiProtocolWithClient, CbBuffers) CHECK(cJSON_IsObject (json_var)); WEE_CHECK_OBJ_STR("core", json_var, "plugin"); WEE_CHECK_OBJ_STR("weechat", json_var, "name"); + gui_buffer_set (gui_buffers, "input_prompt", ""); gui_buffer_set (gui_buffers, "input", ""); gui_buffer_set (gui_buffers, "input_multiline", "0"); @@ -481,6 +485,7 @@ TEST(RelayApiProtocolWithClient, CbBuffers) WEE_CHECK_OBJ_NUM(1, json, "number"); WEE_CHECK_OBJ_STR("formatted", json, "type"); WEE_CHECK_OBJ_STRN("WeeChat", 7, json, "title"); + WEE_CHECK_OBJ_STR("", json, "input_prompt"); WEE_CHECK_OBJ_STR("", json, "input"); WEE_CHECK_OBJ_NUM(0, json, "input_position"); WEE_CHECK_OBJ_BOOL(0, json, "input_multiline");