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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

wqmeng’s picture

ledom’s picture

Need this too... thanks
Any chance it will be include into stable module?

mmtt’s picture

I've installed your patch but it does not show any difference.

wqmeng’s picture

Hello mmtt,

Please look for the following option of the setting page of DrupalChat.

Support Chat Customization
Support Chat - Restrict only chat to support
Yes
No
When you check this, all users who are not supporter can only chat to a supporter.
tnfno’s picture

Same for me, cannot see the extra settings. No errors applying the patch.

Neograph734’s picture

Status: Active » Needs work

Applied 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.

pendaco’s picture

The 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;

-	$my_settings = array(
+    $my_settings = array(
       'current_timestamp' => time(),
       'polling_method' => $polling_method,
       'pollUrl' => url('drupalchat/poll', array('absolute' => TRUE)),

As it's only whitespace.

wqmeng’s picture

Issue summary: View changes
wqmeng’s picture

Version: 7.x-1.3 » 7.x-1.4

I 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.

wqmeng’s picture

Status: Needs work » Needs review
SocialNicheGuru’s picture

Can there be a new permission, 'chat support' added? I would rather not give someone the "administer chat" permission.