diff --git a/CHANGELOG.md b/CHANGELOG.md index b4c8ee420..02517f899 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -66,6 +66,7 @@ - relay/api: close obsolete buffers when reconnecting to the remote - relay/api: fix "body_type" returned when lines or nicks of a buffer are requested - relay/api: fix read of one buffer line +- relay/api: automatically disconnect when the command `/upgrade` is executed on the remote - relay: fix websocket permessage-deflate extension when the client doesn't send the max window bits parameters ([#1549](https://github.com/weechat/weechat/issues/1549)) - relay: fix allocation and reinit of field "client_context_takeover" in websocket deflate structure ([#1549](https://github.com/weechat/weechat/issues/1549)) - spell: improve error displayed when a word can not be added to the dictionary ([#2144](https://github.com/weechat/weechat/issues/2144)) diff --git a/src/plugins/relay/api/remote/relay-remote-event.c b/src/plugins/relay/api/remote/relay-remote-event.c index 09c484fd2..cdea486bd 100644 --- a/src/plugins/relay/api/remote/relay-remote-event.c +++ b/src/plugins/relay/api/remote/relay-remote-event.c @@ -1152,6 +1152,16 @@ RELAY_REMOTE_EVENT_CALLBACK(version) return WEECHAT_RC_OK; } +/* + * Callback for events "upgrade" and "upgrade_ended". + */ + +RELAY_REMOTE_EVENT_CALLBACK(upgrade) +{ + relay_remote_network_disconnect (event->remote); + return WEECHAT_RC_OK; +} + /* * Synchronizes with remote. */ @@ -1208,6 +1218,7 @@ relay_remote_event_recv (struct t_relay_remote *remote, const char *data) { "input_*", &relay_remote_event_cb_input }, { "nicklist_group_*", &relay_remote_event_cb_nick_group }, { "nicklist_nick_*", &relay_remote_event_cb_nick }, + { "upgrade*", &relay_remote_event_cb_upgrade }, { NULL, NULL }, }; t_relay_remote_event_func *callback;