--- notify.inc.orig	2005-10-28 12:36:43.390625000 +0200
+++ notify.inc	2005-10-28 12:36:43.375000000 +0200
@@ -92,11 +92,18 @@
 
 function _notify_send() {
   global $base_url;
+  global $user;
   $period = variable_get('notify_send_last', time() - variable_get('notify_send', 86400));
 
   // Fetch users with notify enabled
   $uresult = db_query("SELECT u.uid, u.name, u.mail, n.status, n.node, n.teasers, n.comment FROM {notify} n INNER JOIN {users} u ON n.uid = u.uid WHERE n.status = 1 AND u.status = 1 ". (($notify_attempts = variable_get('notify_attempts', 5)) ? ' AND n.attempts <= %d' : ''), $notify_attempts);
+  $restore_user = $user;
   while ($user = db_fetch_object($uresult)) {
+    $user->roles = array();
+    $result = db_query ('SELECT r.rid, r.name FROM {role} r INNER JOIN {users_roles} ur ON ur.rid = r.rid WHERE ur.uid = %d', $user->uid );
+    while ($role = db_fetch_object($result)) {
+      $user->roles[$role->rid] = $role->name;
+    }
     // Fetch all new nodes
     $nresult = db_query(db_rewrite_sql('SELECT n.nid, n.body, n.type, n.title, n.promote, n.moderate, n.teaser, n.created, n.changed, u.name FROM {node} n INNER JOIN {users} u ON n.uid = u.uid WHERE n.status = 1 AND n.created > %d ORDER BY n.created'), $period);
     $nodes = array();
@@ -165,6 +172,7 @@
       }
     }
   }
+  $user = $restore_user;
 }
 
 function entities_to_utf8($text) {
