fix: deprecated `share` in `subopts`

This commit is contained in:
JimMoen 2023-08-15 11:22:55 +08:00
parent b5411da770
commit 0ca725ff25
No known key found for this signature in database
GPG Key ID: 87A520B4F76BA86D
4 changed files with 6 additions and 6 deletions

View File

@ -214,7 +214,6 @@
rap := 0 | 1,
nl := 0 | 1,
qos := qos(),
share => binary(),
atom() => term()
}.
-type reason_code() :: 0..16#FF.

View File

@ -460,8 +460,11 @@ message SubOpts {
// The QoS level
uint32 qos = 1;
// deprecated
reserved 2;
reserved "share";
// The group name for shared subscription
string share = 2;
// string share = 2;
// The Retain Handling option (MQTT v5.0)
//

View File

@ -192,7 +192,7 @@ on_session_subscribed(ClientInfo, Topic, SubOpts) ->
Req = #{
clientinfo => clientinfo(ClientInfo),
topic => emqx_topic:maybe_format_share(Topic),
subopts => maps:with([qos, share, rh, rap, nl], SubOpts)
subopts => maps:with([qos, rh, rap, nl], SubOpts)
},
cast('session.subscribed', Req).

View File

@ -546,9 +546,7 @@ subopts(SubOpts) ->
qos => maps:get(qos, SubOpts, 0),
rh => maps:get(rh, SubOpts, 0),
rap => maps:get(rap, SubOpts, 0),
nl => maps:get(nl, SubOpts, 0),
%% TOOD: FIXME for share-sub refactored
share => maps:get(share, SubOpts, <<>>)
nl => maps:get(nl, SubOpts, 0)
}.
authresult_to_bool(AuthResult) ->