Commit d388e75b authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Don't show header in internal forum post notifications


Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent 82519cc6
...@@ -502,6 +502,9 @@ class ActivityTypeInteractionForumNewPost extends ActivityTypePlugin { ...@@ -502,6 +502,9 @@ class ActivityTypeInteractionForumNewPost extends ActivityTypePlugin {
$textbody = trim(html2text($post->body)); $textbody = trim(html2text($post->body));
$postlink = get_config('wwwroot') . 'interaction/forum/topic.php?id=' . $post->topicid . '#post' . $this->postid; $postlink = get_config('wwwroot') . 'interaction/forum/topic.php?id=' . $post->topicid . '#post' . $this->postid;
$this->message = $textbody;
$this->url = $postlink;
foreach ($this->users as &$user) { foreach ($this->users as &$user) {
$lang = (empty($user->lang) || $user->lang == 'default') ? get_config('lang') : $user->lang; $lang = (empty($user->lang) || $user->lang == 'default') ? get_config('lang') : $user->lang;
if ($post->parent) { if ($post->parent) {
...@@ -515,7 +518,7 @@ class ActivityTypeInteractionForumNewPost extends ActivityTypePlugin { ...@@ -515,7 +518,7 @@ class ActivityTypeInteractionForumNewPost extends ActivityTypePlugin {
$unsubscribeid = $post->{$type . 'id'}; $unsubscribeid = $post->{$type . 'id'};
$unsubscribelink = get_config('wwwroot') . 'interaction/forum/unsubscribe.php?' . $type . '=' . $unsubscribeid . '&key=' . $subscribers[$user->id]->key; $unsubscribelink = get_config('wwwroot') . 'interaction/forum/unsubscribe.php?' . $type . '=' . $unsubscribeid . '&key=' . $subscribers[$user->id]->key;
$user->message = get_string_from_language($lang, 'forumposttemplate', 'interaction.forum', $user->emailmessage = get_string_from_language($lang, 'forumposttemplate', 'interaction.forum',
$post->subject ? $post->subject : get_string_from_language($lang, 're', 'interaction.forum', $post->topicsubject), $post->subject ? $post->subject : get_string_from_language($lang, 're', 'interaction.forum', $post->topicsubject),
display_name($post->poster, $user), display_name($post->poster, $user),
$posttime, $posttime,
...@@ -540,10 +543,6 @@ class ActivityTypeInteractionForumNewPost extends ActivityTypePlugin { ...@@ -540,10 +543,6 @@ class ActivityTypeInteractionForumNewPost extends ActivityTypePlugin {
return $user->subject; return $user->subject;
} }
public function get_message($user) {
return $user->message;
}
public function get_plugintype(){ public function get_plugintype(){
return 'interaction'; return 'interaction';
} }
......
...@@ -37,7 +37,12 @@ class PluginNotificationEmail extends PluginNotification { ...@@ -37,7 +37,12 @@ class PluginNotificationEmail extends PluginNotification {
if (!empty($data->overridemessagecontents)) { if (!empty($data->overridemessagecontents)) {
$subject = $data->subject; $subject = $data->subject;
$messagebody = $data->message; if (!empty($user->emailmessage)) {
$messagebody = $user->emailmessage;
}
else {
$messagebody = $data->message;
}
if (!empty($user->htmlmessage)) { if (!empty($user->htmlmessage)) {
$messagehtml = $user->htmlmessage; $messagehtml = $user->htmlmessage;
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment