]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
XMPP bounce message when too long (ticket #112)
authorCiaranG <ciaran@ciarang.com>
Mon, 18 Aug 2008 21:30:31 +0000 (17:30 -0400)
committerCiaranG <ciaran@ciarang.com>
Mon, 18 Aug 2008 21:30:31 +0000 (17:30 -0400)
darcs-hash:20080818213031-f6e2c-760cbb6f91485bbb8b29156c06a16e9ad6cd0acf.gz

scripts/xmppdaemon.php

index 327854ccdc92aed3711ae0c5ca8cb710f21fe586..1aa789e7e7ca6c75d10c4bd0198b7e050ba68c3a 100755 (executable)
@@ -176,6 +176,10 @@ class XMPPDaemon {
                        $this->log(LOG_INFO, 'Ignoring OTR from ' . $from);
                        return;
                } else {
+                       if(strlen($pl['body'])>140) {
+                               $this->from_site($from, 'Message too long - maximum is 140 characters, you sent ' . strlen($pl['body']));
+                               return;
+                       }
                        $this->add_notice($user, $pl);
                }
        }