--- messaging.module-orig	2011-02-17 00:30:37.000000000 +0100
+++ messaging.module	2011-11-04 10:32:32.912570145 +0100
@@ -896,9 +896,21 @@ function messaging_text_replace($text, $
   // Use token_logic if available, http://code.developmentseed.org/token_logic
   // Otherwise use standard contrib token module, http://drupal.org/project/token
   if (module_exists('token_logic')) {
+    if (is_array($text)) {
+      foreach ($text as $no => $line) {
+        $text[$no] = token_logic_replace_multiple($line, $objects);
+      }
+      return $text;
+    }
     return token_logic_replace_multiple($text, $objects);
   }
   else {
+    if (is_array($text)) {
+      foreach ($text as $no => $line) {
+        $text[$no] = token_replace_multiple($line, $objects);
+      }
+      return $text;
+    }
     return token_replace_multiple($text, $objects);
   }
 }
