[pLog-svn] r3245 - plugins/trunk/moblog/class/moblog

oscar at devel.lifetype.net oscar at devel.lifetype.net
Wed Apr 12 20:45:15 GMT 2006


Author: oscar
Date: 2006-04-12 20:45:15 +0000 (Wed, 12 Apr 2006)
New Revision: 3245

Modified:
   plugins/trunk/moblog/class/moblog/moblogrequest.class.php
Log:
implemented a little feature that I needed, so that certain strings could be removed from moblogged messages.


Modified: plugins/trunk/moblog/class/moblog/moblogrequest.class.php
===================================================================
--- plugins/trunk/moblog/class/moblog/moblogrequest.class.php	2006-04-12 20:35:38 UTC (rev 3244)
+++ plugins/trunk/moblog/class/moblog/moblogrequest.class.php	2006-04-12 20:45:15 UTC (rev 3245)
@@ -3,7 +3,15 @@
     include_once( PLOG_CLASS_PATH."plugins/moblog/class/moblog/mimeDecode.class.php" );
     include_once( PLOG_CLASS_PATH."plugins/moblog/class/moblog/moblogconstants.properties.php" );
     include_once( PLOG_CLASS_PATH."plugins/moblog/class/log/mobloglogger.class.php" );
-    include_once( PLOG_CLASS_PATH."class/data/textfilter.class.php" );    
+    include_once( PLOG_CLASS_PATH."class/data/textfilter.class.php" );
+    
+    /**
+     * the following strings will be filtered out from moblogged messages. At least in case
+     * of Finnish Elisa operator, every message is sent including this annoying notice
+     */
+    $_moblog_filter_out = Array(
+      "This is a HTML message, sorry"
+    );
 
     /**
      * contains all the parameters that came in the user's email.
@@ -132,7 +140,12 @@
             $body = str_replace($host[0], "", $body );
             
             // strip off a standard .sig. Properly formed .sigs start with '-- ' on a new line.
-            list($body, $sig) = explode("\n-- ", $body);
+            list($body, $sig) = explode("\n-- ", $body);
+            
+            global $_moblog_filter_out;
+            foreach( $_moblog_filter_out as $str ) {
+                $body = str_replace( $str, '', $body );
+            }
             
             MoblogLogger::log( "parseBody ---> body = $body" );
             $body = trim($body);            



More information about the pLog-svn mailing list