Index: drupalchat.admin.inc
===================================================================
--- drupalchat.admin.inc	(revision 4994)
+++ drupalchat.admin.inc	(working copy)
@@ -183,8 +183,8 @@
   );
   $access = user_access('use PHP for settings');
   $options = array(
-    0 => t('All pages except those listed'),
-    1 => t('Only the listed pages'),
+    0 => t('All except those listed'),
+    1 => t('Only listed'),
   );
   $description = t("Specify pages by using their paths. Enter one path per line. The '*' character is a wildcard. Example paths are %blog for the blog page and %blog-wildcard for every personal blog. %front is the front page.", array('%blog' => 'blog', '%blog-wildcard' => 'blog/*', '%front' => '<front>'));
 
@@ -209,6 +209,19 @@
     '#description' => $description,
   );
   
+  $form['drupalchat_path']['drupalchat_domain_visibility'] = array(
+    '#type' => 'radios',
+    '#title' => t('Show DrupalChat on specific domains'),
+    '#options' => $options,
+    '#default_value' => variable_get('drupalchat_domain_visibility', 0),
+  );
+  $form['drupalchat_path']['drupalchat_domain_domains'] = array(
+    '#type' => 'textarea',
+    '#title' => '<span>' . t("Domains") . '</span>',
+    '#default_value' => variable_get('drupalchat_domain_domains', NULL),
+    '#description' => t("Insert the domains one per line, whithout http://"),
+  );
+  
   $form['drupalchat_css'] = array(
     '#type' => 'fieldset',
     '#title' => t('Theme Customization'),
Index: drupalchat.module
===================================================================
--- drupalchat.module	(revision 4994)
+++ drupalchat.module	(working copy)
@@ -34,6 +34,7 @@
 function drupalchat_verify_access() {
   global $user;
   $sid = _drupalchat_get_sid();
+  
   // Match path if necessary.
   $page_match = FALSE;
   if (variable_get('drupalchat_path_pages', NULL)) {
@@ -64,7 +65,37 @@
   else {
     $page_match = TRUE;
   }
-  return ((((variable_get('drupalchat_rel', DRUPALCHAT_REL_AUTH) == DRUPALCHAT_REL_AUTH) && ($user->uid==0)) || ($user->uid>0)) && $page_match && user_access('access drupalchat') && ($sid != -1));
+  
+ 
+  
+   // Match domain if necessary.
+  $currentDomain = drupal_strtolower($_SERVER["SERVER_NAME"]);
+  $domain_match = FALSE;
+  if (variable_get('drupalchat_domain_domains', NULL)) {
+
+	$domains = explode("\n",drupal_strtolower(variable_get('drupalchat_domain_domains', "")));
+  
+    if (variable_get('drupalchat_domain_visibility', 0) < 2) {
+	
+		foreach($domains as $d) {
+			if (trim($d) == $currentDomain) {
+				$domain_match = TRUE;
+			}
+		}
+	
+		$domain_match = !(variable_get('drupalchat_domain_visibility', 0) xor $domain_match);
+    }
+    else {
+      $domain_match = FALSE;
+    }
+  }
+  else {
+    $domain_match = TRUE;
+  }
+  
+
+  
+  return ((((variable_get('drupalchat_rel', DRUPALCHAT_REL_AUTH) == DRUPALCHAT_REL_AUTH) && ($user->uid==0)) || ($user->uid>0)) && $page_match && $domain_match && user_access('access drupalchat') && ($sid != -1));
 }
 
 function _drupalchat_get_sid($create = TRUE) {
