forked from GNUsocial/gnu-social
Fixes for GroupPrivateMessage, OStatus due to changes in group output events, and some internal bugs using wrong vars
This commit is contained in:
parent
ab6a168d68
commit
a390e3e888
@ -348,14 +348,15 @@ class GroupPrivateMessagePlugin extends Plugin
|
|||||||
/**
|
/**
|
||||||
* To add a "Message" button to the group profile page
|
* To add a "Message" button to the group profile page
|
||||||
*
|
*
|
||||||
* @param Action $action The showgroup action being shown
|
* @param Widget $widget The showgroup action being shown
|
||||||
* @param User_group $group The current group
|
* @param User_group $group The current group
|
||||||
*
|
*
|
||||||
* @return boolean hook value
|
* @return boolean hook value
|
||||||
*/
|
*/
|
||||||
function onEndGroupActionsList($action, $group)
|
function onEndGroupActionsList($widget, $group)
|
||||||
{
|
{
|
||||||
$cur = common_current_user();
|
$cur = common_current_user();
|
||||||
|
$action = $widget->out;
|
||||||
|
|
||||||
if (empty($cur)) {
|
if (empty($cur)) {
|
||||||
return true;
|
return true;
|
||||||
@ -402,6 +403,7 @@ class GroupPrivateMessagePlugin extends Plugin
|
|||||||
$ignored = array();
|
$ignored = array();
|
||||||
|
|
||||||
$forcePrivate = false;
|
$forcePrivate = false;
|
||||||
|
$profile = $notice->getProfile();
|
||||||
|
|
||||||
if ($count > 0) {
|
if ($count > 0) {
|
||||||
|
|
||||||
|
@ -156,9 +156,7 @@ class Group_message_profile extends Memcached_DataObject
|
|||||||
|
|
||||||
// TRANS: Subject for direct-message notification email.
|
// TRANS: Subject for direct-message notification email.
|
||||||
// TRANS: %s is the sending user's nickname.
|
// TRANS: %s is the sending user's nickname.
|
||||||
$subject = sprintf(_('New private message from %s to group %s'), $from->nickname, $group->nickname);
|
$subject = sprintf(_('New private message from %s to group %s'), $from_profile->nickname, $group->nickname);
|
||||||
|
|
||||||
$from_profile = $from->getProfile();
|
|
||||||
|
|
||||||
// TRANS: Body for direct-message notification email.
|
// TRANS: Body for direct-message notification email.
|
||||||
// TRANS: %1$s is the sending user's long name, %2$s is the sending user's nickname,
|
// TRANS: %1$s is the sending user's long name, %2$s is the sending user's nickname,
|
||||||
@ -174,13 +172,13 @@ class Group_message_profile extends Memcached_DataObject
|
|||||||
"With kind regards,\n".
|
"With kind regards,\n".
|
||||||
"%6\$s\n"),
|
"%6\$s\n"),
|
||||||
$from_profile->getBestName(),
|
$from_profile->getBestName(),
|
||||||
$from->nickname,
|
$from_profile->nickname,
|
||||||
$group->nickname,
|
$group->nickname,
|
||||||
$this->content,
|
$gm->content,
|
||||||
common_local_url('newmessage', array('to' => $from->id)),
|
common_local_url('newmessage', array('to' => $from_profile->id)),
|
||||||
common_config('site', 'name'));
|
common_config('site', 'name'));
|
||||||
|
|
||||||
$headers = _mail_prepare_headers('message', $to->nickname, $from->nickname);
|
$headers = _mail_prepare_headers('message', $to->nickname, $from_profile->nickname);
|
||||||
|
|
||||||
common_switch_locale();
|
common_switch_locale();
|
||||||
|
|
||||||
|
@ -228,7 +228,7 @@ class OStatusPlugin extends Plugin
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function onStartGroupSubscribe($output, $group)
|
function onStartGroupSubscribe($widget, $group)
|
||||||
{
|
{
|
||||||
$cur = common_current_user();
|
$cur = common_current_user();
|
||||||
|
|
||||||
@ -236,7 +236,7 @@ class OStatusPlugin extends Plugin
|
|||||||
// Add an OStatus subscribe
|
// Add an OStatus subscribe
|
||||||
$url = common_local_url('ostatusinit',
|
$url = common_local_url('ostatusinit',
|
||||||
array('group' => $group->nickname));
|
array('group' => $group->nickname));
|
||||||
$output->element('a', array('href' => $url,
|
$widget->out->element('a', array('href' => $url,
|
||||||
'class' => 'entity_remote_subscribe'),
|
'class' => 'entity_remote_subscribe'),
|
||||||
// TRANS: Link description for link to join a remote group.
|
// TRANS: Link description for link to join a remote group.
|
||||||
_m('Join'));
|
_m('Join'));
|
||||||
|
Loading…
Reference in New Issue
Block a user