diff options
author | Simon L'nu <simon.lnu@gmail.com> | 2012-04-30 06:02:38 -0400 |
---|---|---|
committer | Simon L'nu <simon.lnu@gmail.com> | 2012-04-30 06:02:38 -0400 |
commit | 9b7dac6ce19e99ae9341329f422685626146fbdb (patch) | |
tree | dbf505881b60a675492d299d94ec6fb7875c8fac /mod/dfrn_confirm.php | |
parent | 34eb843fb486b9487f02553c1b791892bb7615fc (diff) | |
parent | 9f18c9d664d44ce4d2bfe092bf1a8a154d31ac5f (diff) | |
download | volse-hubzilla-9b7dac6ce19e99ae9341329f422685626146fbdb.tar.gz volse-hubzilla-9b7dac6ce19e99ae9341329f422685626146fbdb.tar.bz2 volse-hubzilla-9b7dac6ce19e99ae9341329f422685626146fbdb.zip |
Merge branch 'master', remote-tracking branch 'remotes/upstream/master'
* remotes/upstream/master:
provide "xxx joined yyy" notifications
adding META viewport tag for better look on tablets
Update Esperanto to 100%
DE update to the strings
activitystreams schema constants for "join group"
missed a db field
typo in profile_selectors, fix remote tagging
not all profile selector choices have unique or direct translations
log db error strings in all cases
admin page to manage failed updates
improved db error logging
close one menu (like the notifications menu) when another one is opened (like it is done when clicking somewhere else) (thx to ^mw)
* master:
Diffstat (limited to 'mod/dfrn_confirm.php')
-rw-r--r-- | mod/dfrn_confirm.php | 45 |
1 files changed, 34 insertions, 11 deletions
diff --git a/mod/dfrn_confirm.php b/mod/dfrn_confirm.php index efb5be3a4..6f7b925ac 100644 --- a/mod/dfrn_confirm.php +++ b/mod/dfrn_confirm.php @@ -434,9 +434,14 @@ function dfrn_confirm_post(&$a,$handsfree = null) { else $contact = null; - if(isset($new_relation) && $new_relation == CONTACT_IS_FRIEND) { - if(($contact) && ($contact['network'] === NETWORK_DIASPORA)) { + $forum_type = false; + if($user['page-flags'] == PAGE_SOAPBOX || $user['page-flags'] == PAGE_COMMUNITY) + $forum_type = true; + + if((isset($new_relation) && $new_relation == CONTACT_IS_FRIEND) || ($forum_type)) { + + if(($contact) && ($contact['network'] === NETWORK_DIASPORA) && (! $forum_type)) { require_once('include/diaspora.php'); $ret = diaspora_share($user[0],$r[0]); logger('mod_follow: diaspora_share returns: ' . $ret); @@ -468,19 +473,37 @@ function dfrn_confirm_post(&$a,$handsfree = null) { $arr['author-name'] = $arr['owner-name'] = $self[0]['name']; $arr['author-link'] = $arr['owner-link'] = $self[0]['url']; $arr['author-avatar'] = $arr['owner-avatar'] = $self[0]['thumb']; - $arr['verb'] = ACTIVITY_FRIEND; - $arr['object-type'] = ACTIVITY_OBJ_PERSON; - + $A = '[url=' . $self[0]['url'] . ']' . $self[0]['name'] . '[/url]'; + $APhoto = '[url=' . $self[0]['url'] . ']' . '[img]' . $self[0]['thumb'] . '[/img][/url]'; + $B = '[url=' . $contact['url'] . ']' . $contact['name'] . '[/url]'; $BPhoto = '[url=' . $contact['url'] . ']' . '[img]' . $contact['thumb'] . '[/img][/url]'; - $arr['body'] = sprintf( t('%1$s is now friends with %2$s'), $A, $B)."\n\n\n".$BPhoto; - $arr['object'] = '<object><type>' . ACTIVITY_OBJ_PERSON . '</type><title>' . $contact['name'] . '</title>' - . '<id>' . $contact['url'] . '/' . $contact['name'] . '</id>'; - $arr['object'] .= '<link>' . xmlify('<link rel="alternate" type="text/html" href="' . $contact['url'] . '" />' . "\n"); - $arr['object'] .= xmlify('<link rel="photo" type="image/jpeg" href="' . $contact['thumb'] . '" />' . "\n"); - $arr['object'] .= '</link></object>' . "\n"; + if($forum_type) { + $arr['verb'] = ACTIVITY_JOIN; + $arr['object-type'] = ACTIVITY_OBJ_GROUP; + $arr['body'] = sprintf( t('%1$s joined %2$s'), $B, $A)."\n\n\n".$APhoto; + $arr['object'] = '<object><type>' . ACTIVITY_OBJ_GROUP . '</type><title>' . $self[0]['name'] . '</title>' + . '<id>' . $self[0]['url'] . '/' . $self[0]['name'] . '</id>'; + $arr['object'] .= '<link>' . xmlify('<link rel="alternate" type="text/html" href="' . $self[0]['url'] . '" />' . "\n"); + $arr['object'] .= xmlify('<link rel="photo" type="image/jpeg" href="' . $self[0]['thumb'] . '" />' . "\n"); + $arr['object'] .= '</link></object>' . "\n"; + + } + else { + $arr['verb'] = ACTIVITY_FRIEND; + $arr['object-type'] = ACTIVITY_OBJ_PERSON; + $arr['body'] = sprintf( t('%1$s is now friends with %2$s'), $A, $B)."\n\n\n".$BPhoto; + + $arr['object'] = '<object><type>' . ACTIVITY_OBJ_PERSON . '</type><title>' . $contact['name'] . '</title>' + . '<id>' . $contact['url'] . '/' . $contact['name'] . '</id>'; + $arr['object'] .= '<link>' . xmlify('<link rel="alternate" type="text/html" href="' . $contact['url'] . '" />' . "\n"); + $arr['object'] .= xmlify('<link rel="photo" type="image/jpeg" href="' . $contact['thumb'] . '" />' . "\n"); + $arr['object'] .= '</link></object>' . "\n"; + } + + $arr['last-child'] = 1; $arr['allow_cid'] = $user[0]['allow_cid']; |