]> granicus.if.org Git - ejabberd/commitdiff
If a participant can change subject, let asubscriber too (#1345)
authorBadlop <badlop@process-one.net>
Thu, 20 Oct 2016 18:34:48 +0000 (20:34 +0200)
committerBadlop <badlop@process-one.net>
Thu, 20 Oct 2016 18:35:00 +0000 (20:35 +0200)
src/mod_muc_room.erl

index 5bee4f0b780781abe8fcbecf384e0231d0ab0976..6010e0bbf5e8c5236fb57ba2aed0762288d0895f 100644 (file)
@@ -959,6 +959,7 @@ process_groupchat_message(From,
                                                _ ->
                                                    case
                                                      can_change_subject(Role,
+                                                                        IsSubscriber,
                                                                         StateData)
                                                        of
                                                      true ->
@@ -2821,10 +2822,10 @@ check_subject(Packet) ->
       SubjEl -> fxml:get_tag_cdata(SubjEl)
     end.
 
-can_change_subject(Role, StateData) ->
+can_change_subject(Role, IsSubscriber, StateData) ->
     case (StateData#state.config)#config.allow_change_subj
        of
-      true -> Role == moderator orelse Role == participant;
+      true -> Role == moderator orelse Role == participant orelse IsSubscriber == true;
       _ -> Role == moderator
     end.