Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello,
I add a option that to restrict a user or a anonymous user can only chat to support who has the permission of administer drupalchat. That mean if you check this option to YES, all user who-self is not a supporter can only see the supporters in the chat list. A supporter can see all users in the chat list.
For now, a supporter is a user who has the permission of "administer drupalchat".
To find the setting option, Go to the admin/config/drupalchat/configuration page, Theme Customization -> Support Chat Customization -> Support Chat - Restrict only chat to support.
Comment | File | Size | Author |
---|---|---|---|
#1 | drupalchat.drupalchat_support_restrict_only_chat_to_support.patch | 4.29 KB | wqmeng |
Comments
Comment #1
wqmeng CreditAttribution: wqmeng commentedComment #2
ledom CreditAttribution: ledom commentedNeed this too... thanks
Any chance it will be include into stable module?
Comment #3
mmtt CreditAttribution: mmtt commentedI've installed your patch but it does not show any difference.
Comment #4
wqmeng CreditAttribution: wqmeng commentedHello mmtt,
Please look for the following option of the setting page of DrupalChat.
Comment #5
tnfno CreditAttribution: tnfno commentedSame for me, cannot see the extra settings. No errors applying the patch.
Comment #6
Neograph734Applied the patch, but it has whitespace errors, please correct those and then set issue status to 'needs review'. For now it still needs some work.
As the other people here, I don't see the setting. In fact, I don't see the entire drupalchat_css fieldgroup ('Theme Customization' in the settings form). Any ideas on that?
When manually enabling this module in the code, an anonymous user still had other guest users appearing in the buddy list. But messages didn't come through somehow, so I am not sure about that.
Thanks for starting on this! It should be just what I need.
Comment #7
pendaco CreditAttribution: pendaco commentedThe code works but there are indeed some errors;
$form['drupalchat_css']['drupalchat_support']['drupalchat_support_restrict_only_chat_to_support'] = array(
This places the select option under the polling method > iFlyChat server
Change to;
$form['drupalchat_general_settings']['drupalchat_support_restrict_only_chat_to_support'] = array(
to have the option available for all polling methods, 'normal ajax' etc.
After enabling the option it seems to work okay. Only my user with support rights shows up for normal users. The user with support rights sees all other users.
And the following change doesn't seem to be necessary;
As it's only whitespace.
Comment #8
wqmeng CreditAttribution: wqmeng commentedComment #9
wqmeng CreditAttribution: wqmeng commentedI have just updated my drupalchat to 7.x-1.4 and patched this, have no problems. It should be still work. To find where to config the option, Theme Customization -> Support Chat Customization -> Support Chat - Restrict only chat to support.
To pendaco: The config option also can be placed to 'DrupalChat General Settings', but it should be no effect with the 'polling methods'. For the whitespace errors, I will remove the errors once the patch need a update.
Thank you all.
Comment #10
wqmeng CreditAttribution: wqmeng commentedComment #11
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedCan there be a new permission, 'chat support' added? I would rather not give someone the "administer chat" permission.