Added sendNotification flag to WebGUI::Friends::rejectAddRequest. Added setting which supresses friend rejection notices from the inbox.

This commit is contained in:
khenn 2010-05-13 17:15:41 -05:00
parent 6dbd389c86
commit b0c7c1162d
6 changed files with 50 additions and 11 deletions

View file

@ -237,6 +237,12 @@ sub editSettingsForm {
hoverHelp => $i18n->get('send inbox notifications only help'),
defaultValue => $setting->get('sendInboxNotificationsOnly'),
);
$f->yesNo(
name => 'sendRejectNotice',
label => $i18n->get('send reject notice'),
hoverHelp => $i18n->get('send reject notice help'),
defaultValue => $setting->get('sendRejectNotice'),
);
$f->text(
name => 'inboxNotificationsSubject',
label => $i18n->get('inbox notifications subject'),
@ -305,6 +311,7 @@ sub editSettingsFormSave {
$setting->set("inboxNotificationsSubject", $form->process("inboxNotificationsSubject", "text"));
$setting->set("inboxNotificationTemplateId", $form->process("inboxNotificationTemplateId","template"));
$setting->set("inboxSmsNotificationTemplateId", $form->process("inboxSmsNotificationTemplateId","template"));
$setting->set("sendRejectNotice", $form->process("sendRejectNotice","yesNo"));
}
@ -604,7 +611,7 @@ sub www_approveDenyInvitations {
next unless ($invite->{inviterId}); #Not sure how this could ever happen, but check for it
next unless ($session->user->userId eq $invite->{friendId}); #Protect against malicious stuff
if($deny) {
$friends->rejectAddRequest($inviteId);
$friends->rejectAddRequest($inviteId,$session->setting->get("sendRejectNotice"));
}
elsif($approve) {
$friends->approveAddRequest($inviteId);