Index: privatemsg_filter.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/privatemsg/privatemsg_filter/privatemsg_filter.module,v
retrieving revision 1.1.2.20
diff -u -r1.1.2.20 privatemsg_filter.module
--- privatemsg_filter.module	14 Oct 2009 14:19:00 -0000	1.1.2.20
+++ privatemsg_filter.module	14 Oct 2009 23:36:12 -0000
@@ -217,8 +217,8 @@
   foreach ($threads as $thread) {
     // Make sure that we don't add a tag to a thread twice,
     // only insert if there is no such tag yet.
-    if (db_result(db_query('SELECT COUNT(*) FROM {pm_tags_index} WHERE tag_id = %d AND (uid = %d AND thread_id = %d)', $tag_id, $user->uid, $thread)) == 0) {
-      db_query('INSERT INTO {pm_tags_index} (tag_id, uid, thread_id) VALUES (%d, %d, %d)', $tag_id, $user->uid, $thread);
+    if (db_result(db_query('SELECT COUNT(*) FROM {pm_tags_index} WHERE tag_id = %d AND (uid = %d AND thread_id = %d)', $tag_id, $account->uid, $thread)) == 0) {
+      db_query('INSERT INTO {pm_tags_index} (tag_id, uid, thread_id) VALUES (%d, %d, %d)', $tag_id, $account->uid, $thread);
     }
   }
 }

