Ticket #353: friend-comm-messages.diff
| File friend-comm-messages.diff, 5.8 kB (added by justinr, 4 months ago) |
|---|
-
mod/friend/lib/friends_actions.php
old new 25 25 $u = get_record('users','ident',$friend_id); 26 26 $message_body = sprintf(__gettext("%s has added you as a friend!\n\nTo visit this user's profile, click on the following link:\n\n\t%s\n\nTo view all your friends, click here:\n\n\t%s\n\nRegards,\n\nThe %s team."),$_SESSION['name'], $CFG->wwwroot . user_info("username",$USER->ident) . "/", $CFG->wwwroot . user_info("username",$friend_id) . "/friends/",$CFG->sitename); 27 27 $title = sprintf(__gettext("New %s friend"), $CFG->sitename); 28 notify_user($u,$title,$message_body);28 message_user($u,$USER->ident,$title,$message_body); 29 29 plugin_hook('friends','publish',$f); 30 30 } 31 31 } else { … … 40 40 $u = get_record('users','ident',$friend_id); 41 41 $message_body = sprintf(__gettext("%s has requested to add you as a friend!\n\nTo visit this user's profile, click on the following link:\n\n\t%s\n\nTo view all your friends requests and approve or deny this user, click here:\n\n\t%s\n\nRegards,\n\nThe %s team."),$_SESSION['name'], $CFG->wwwroot . user_info("username",$USER->ident) . "/", $CFG->wwwroot . user_info("username",$friend_id) . "/friends/requests",$CFG->sitename); 42 42 $title = sprintf(__gettext("New %s friend request"), $CFG->sitename); 43 notify_user($u,$title,$message_body);43 message_user($u,$USER->ident,$title,$message_body); 44 44 } 45 45 } else { 46 46 if (user_info("user_type",$friend_id) == "person") { … … 89 89 $messages[] = sprintf(__gettext("You approved the friendship request. %s now lists you as a friend."),stripslashes($request->name)); 90 90 $message_body = sprintf(__gettext("%s has approved your friendship request!\n\nTo visit this user's profile, click on the following link:\n\n\t%s\n\nTo view all your friends, click here:\n\n\t%s\n\nRegards,\n\nThe %s team."),user_name($request->friend), $CFG->wwwroot . user_info("username",$request->friend) . "/", $CFG->wwwroot . user_info("username",$request->owner) . "/friends/",$CFG->sitename); 91 91 $title = sprintf(__gettext("%s friend request approved!"), $CFG->sitename); 92 notify_user($request->owner,$title,$message_body);92 message_user($request->owner,$request->friend,$title,$message_body); 93 93 plugin_hook('friends','publish',$f); 94 94 } else { 95 95 $messages[] = __gettext("An error occurred: couldn't add you as a friend"); … … 115 115 $messages[] = sprintf(__gettext("You declined the friendship request. %s does not list you as a friend."),stripslashes($request->name)); 116 116 $message_body = sprintf(__gettext("%s has denied your friendship request.\n\nTo visit this user's profile, click on the following link:\n\n\t%s\n\nTo view all your existing friends, click here:\n\n\t%s\n\nRegards,\n\nThe %s team."),user_name($request->friend), $CFG->wwwroot . user_info("username",$request->friend) . "/", $CFG->wwwroot . user_info("username",$request->owner) . "/friends/",$CFG->sitename); 117 117 $title = sprintf(__gettext("%s friend request denied"), $CFG->sitename); 118 notify_user($request->owner,$title,$message_body);118 message_user($request->owner,$request->friend,$title,$message_body); 119 119 } else { 120 120 $messages[] = __gettext("Error: you do not have authority to modify this friendship request."); 121 121 } -
mod/community/lib/community_member_add.php
old new 29 29 30 30 $message_body= sprintf(__gettext("%s has joined %s!\n\nTo visit this user's profile, click on the following link:\n\n\t%s\n\nTo view all community members, click here:\n\n\t%s\n\nRegards,\n\nThe %s team."), $_SESSION['name'], $friend->name, $CFG->wwwroot . user_info("username", $USER->ident) . "/", $CFG->wwwroot . $friend->username . "/community/members", $CFG->sitename); 31 31 $title= sprintf(__gettext("New %s member"), $friend->name); 32 notify_user($owner->ident, $title, $message_body);32 message_user($owner->ident, $friend_id, $title, $message_body); 33 33 plugin_hook("community:member","publish",$f); 34 34 35 35 } else … … 39 39 $message_body= sprintf(__gettext("%s has applied to join %s!\n\nTo visit this user's profile, click on the following link:\n\n\t" . 40 40 "%s\n\nTo view all membership requests and approve or deny this user, click here:\n\n\t%s\n\nRegards,\n\nThe %s team."), $_SESSION['name'], $friend->name, $CFG->wwwroot . user_info("username", $USER->ident) . "/", $CFG->wwwroot . $friend->username . "/community/members", $CFG->sitename); 41 41 $title= sprintf(__gettext("New %s member request"), $friend->name); 42 notify_user($owner->ident, $title, $message_body);42 message_user($owner->ident, $friend_id, $title, $message_body); 43 43 } 44 44 } else 45 45 if ($friend->moderation == "priv") {
