+ $prefix = $facebook->api_client->data_getUserPreference(FACEBOOK_NOTICE_PREFIX, $fbuid);
+ $content = "$prefix $notice->content";
+
+ if (($flink->noticesync & FOREIGN_NOTICE_SEND) == FOREIGN_NOTICE_SEND) {
+
+ // If it's not a reply, or if the user WANTS to send replies...
+ if (!preg_match('/@[a-zA-Z0-9_]{1,15}\b/u', $content) ||
+ (($flink->noticesync & FOREIGN_NOTICE_SEND_REPLY) == FOREIGN_NOTICE_SEND_REPLY)) {
+
+ // Avoid a Loop
+ if ($notice->source != 'Facebook') {
+
+ try {
+ $facebook->api_client->users_setStatus($content,
+ $fbuid, false, true);
+ updateProfileBox($facebook, $flink, $notice);
+ $cnt++;
+ } catch(FacebookRestClientException $e) {
+ print "Couldn't sent notice $notice->id!\n";
+ print $e->getMessage();
+
+ // Remove flink?
+ }
+ }
+ }
+ }