diff options
Diffstat (limited to 'addon')
-rw-r--r-- | addon/facebook/facebook.php | 25 | ||||
-rw-r--r-- | addon/statusnet/statusnet.php | 2 |
2 files changed, 24 insertions, 3 deletions
diff --git a/addon/facebook/facebook.php b/addon/facebook/facebook.php index 17cc8bf56..cd1ae4aa3 100644 --- a/addon/facebook/facebook.php +++ b/addon/facebook/facebook.php @@ -505,6 +505,21 @@ function facebook_post_hook(&$a,&$b) { $msg = trim(strip_tags(bbcode($msg))); $msg = html_entity_decode($msg,ENT_QUOTES,'UTF-8'); + // add any attachments as text urls + + $arr = explode(',',$b['attach']); + + if(count($arr)) { + $msg .= "\n"; + foreach($arr as $r) { + $matches = false; + $cnt = preg_match('|\[attach\]href=\"(.+?)\" size=\"(.+?)\" type=\"(.+?)\" title=\"(.+?)\"\[\/attach\]|',$r,$matches); + if($cnt) { + $msg .= $matches[1]; + } + } + } + if (strlen($msg) > FACEBOOK_MAXPOSTLEN) { $shortlink = ""; require_once('library/slinky.php'); @@ -718,11 +733,17 @@ function fb_consume_stream($uid,$j,$wall = false) { if(! $orig_post) continue; - $r = q("SELECT * FROM `item` WHERE `parent-uri` = '%s' AND `uid` = %d AND `verb` = '%s' AND `author-link` = '%s' LIMIT 1", + // If we posted the like locally, it will be found with our url, not the FB url. + + $second_url = (($likes->id == $self_id) ? $self[0]['url'] : 'http://facebook.com/profile.php?id=' . $likes->id); + + $r = q("SELECT * FROM `item` WHERE `parent-uri` = '%s' AND `uid` = %d AND `verb` = '%s' + AND ( `author-link` = '%s' OR `author-link` = '%s' ) LIMIT 1", dbesc($orig_post['uri']), intval($uid), dbesc(ACTIVITY_LIKE), - dbesc('http://facebook.com/profile.php?id=' . $likes->id) + dbesc('http://facebook.com/profile.php?id=' . $likes->id), + dbesc($second_url) ); if(count($r)) diff --git a/addon/statusnet/statusnet.php b/addon/statusnet/statusnet.php index bd40f78d8..39df7d962 100644 --- a/addon/statusnet/statusnet.php +++ b/addon/statusnet/statusnet.php @@ -207,7 +207,7 @@ function statusnet_settings(&$a,&$s) { */ if (! $globalsn == null) { $s .= '<h4>' . t('Globally Available StatusNet OAuthKeys') . '</h4>'; - $s .= '<p>'. t('There are preconfigured OAuth key pairs for some StatusNet servers available. If you are useing one of them, please use these credentials. If not feel free to connect to any other StatusNet instance (see below).') .'</p>'; + $s .= '<p>'. t("There are preconfigured OAuth key pairs for some StatusNet servers available. If you are useing one of them, please use these credentials. If not feel free to connect to any other StatusNet instance \x28see below\x29.") .'</p>'; $s .= '<div id="statusnet-preconf-wrapper">'; foreach ($globalsn as $asn) { $s .= '<input type="radio" name="statusnet-preconf-apiurl" value="'. $asn['apiurl'] .'">'. $asn['sitename'] .'<br />'; |