MOBILE-2620 messages: New interface for blocking/unblocking users
parent
70dd9302ec
commit
067d674ac6
|
@ -132,9 +132,9 @@
|
||||||
"addon.files.sitefiles": "moodle",
|
"addon.files.sitefiles": "moodle",
|
||||||
"addon.messageoutput_airnotifier.processorsettingsdesc": "local_moodlemobileapp",
|
"addon.messageoutput_airnotifier.processorsettingsdesc": "local_moodlemobileapp",
|
||||||
"addon.messages.addcontact": "message",
|
"addon.messages.addcontact": "message",
|
||||||
"addon.messages.blockcontact": "message",
|
|
||||||
"addon.messages.blockcontactconfirm": "local_moodlemobileapp",
|
|
||||||
"addon.messages.blocknoncontacts": "message",
|
"addon.messages.blocknoncontacts": "message",
|
||||||
|
"addon.messages.blockuser": "message",
|
||||||
|
"addon.messages.blockuserconfirm": "message",
|
||||||
"addon.messages.contactableprivacy": "message",
|
"addon.messages.contactableprivacy": "message",
|
||||||
"addon.messages.contactableprivacy_coursemember": "message",
|
"addon.messages.contactableprivacy_coursemember": "message",
|
||||||
"addon.messages.contactableprivacy_onlycontacts": "message",
|
"addon.messages.contactableprivacy_onlycontacts": "message",
|
||||||
|
@ -163,7 +163,8 @@
|
||||||
"addon.messages.type_online": "local_moodlemobileapp",
|
"addon.messages.type_online": "local_moodlemobileapp",
|
||||||
"addon.messages.type_search": "local_moodlemobileapp",
|
"addon.messages.type_search": "local_moodlemobileapp",
|
||||||
"addon.messages.type_strangers": "local_moodlemobileapp",
|
"addon.messages.type_strangers": "local_moodlemobileapp",
|
||||||
"addon.messages.unblockcontact": "message",
|
"addon.messages.unblockuser": "message",
|
||||||
|
"addon.messages.unblockuserconfirm": "message",
|
||||||
"addon.messages.warningmessagenotsent": "local_moodlemobileapp",
|
"addon.messages.warningmessagenotsent": "local_moodlemobileapp",
|
||||||
"addon.mod_assign.acceptsubmissionstatement": "local_moodlemobileapp",
|
"addon.mod_assign.acceptsubmissionstatement": "local_moodlemobileapp",
|
||||||
"addon.mod_assign.addattempt": "assign",
|
"addon.mod_assign.addattempt": "assign",
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
{
|
{
|
||||||
"addcontact": "Add contact",
|
"addcontact": "Add contact",
|
||||||
"blockcontact": "Block contact",
|
|
||||||
"blockcontactconfirm": "You will no longer receive messages from this contact.",
|
|
||||||
"blocknoncontacts": "Prevent non-contacts from messaging me",
|
"blocknoncontacts": "Prevent non-contacts from messaging me",
|
||||||
|
"blockuser": "Block user",
|
||||||
|
"blockuserconfirm": "Are you sure you want to block {{$a}}?",
|
||||||
"contactableprivacy": "Accept messages from:",
|
"contactableprivacy": "Accept messages from:",
|
||||||
"contactableprivacy_coursemember": "My contacts and anyone in my courses",
|
"contactableprivacy_coursemember": "My contacts and anyone in my courses",
|
||||||
"contactableprivacy_onlycontacts": "My contacts only",
|
"contactableprivacy_onlycontacts": "My contacts only",
|
||||||
|
@ -31,6 +31,7 @@
|
||||||
"type_online": "Online",
|
"type_online": "Online",
|
||||||
"type_search": "Search results",
|
"type_search": "Search results",
|
||||||
"type_strangers": "Others",
|
"type_strangers": "Others",
|
||||||
"unblockcontact": "Unblock contact",
|
"unblockuser": "Unblock user",
|
||||||
|
"unblockuserconfirm": "Are you sure you want to unblock {{$a}}?",
|
||||||
"warningmessagenotsent": "Couldn't send message(s) to user {{user}}. {{error}}"
|
"warningmessagenotsent": "Couldn't send message(s) to user {{user}}. {{error}}"
|
||||||
}
|
}
|
|
@ -96,12 +96,17 @@ export class AddonMessagesBlockContactUserHandler implements CoreUserProfileHand
|
||||||
|
|
||||||
this.messagesProvider.isBlocked(user.id).then((isBlocked) => {
|
this.messagesProvider.isBlocked(user.id).then((isBlocked) => {
|
||||||
if (isBlocked) {
|
if (isBlocked) {
|
||||||
return this.messagesProvider.unblockContact(user.id);
|
const template = this.translate.instant('addon.messages.unblockuserconfirm', {$a: user.fullname});
|
||||||
} else {
|
const okText = this.translate.instant('addon.messages.unblockuser');
|
||||||
const template = this.translate.instant('addon.messages.blockcontactconfirm'),
|
|
||||||
title = this.translate.instant('addon.messages.blockcontact');
|
|
||||||
|
|
||||||
return this.domUtils.showConfirm(template, title, title).then(() => {
|
return this.domUtils.showConfirm(template, undefined, okText).then(() => {
|
||||||
|
return this.messagesProvider.unblockContact(user.id);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
const template = this.translate.instant('addon.messages.blockuserconfirm', {$a: user.fullname});
|
||||||
|
const okText = this.translate.instant('addon.messages.blockuser');
|
||||||
|
|
||||||
|
return this.domUtils.showConfirm(template, undefined, okText).then(() => {
|
||||||
return this.messagesProvider.blockContact(user.id);
|
return this.messagesProvider.blockContact(user.id);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -129,7 +134,7 @@ export class AddonMessagesBlockContactUserHandler implements CoreUserProfileHand
|
||||||
return this.messagesProvider.isBlocked(userId).then((isBlocked) => {
|
return this.messagesProvider.isBlocked(userId).then((isBlocked) => {
|
||||||
if (isBlocked) {
|
if (isBlocked) {
|
||||||
this.updateButton(userId, {
|
this.updateButton(userId, {
|
||||||
title: 'addon.messages.unblockcontact',
|
title: 'addon.messages.unblockuser',
|
||||||
class: 'addon-messages-unblockcontact-handler',
|
class: 'addon-messages-unblockcontact-handler',
|
||||||
icon: 'checkmark-circle',
|
icon: 'checkmark-circle',
|
||||||
hidden: false,
|
hidden: false,
|
||||||
|
@ -137,7 +142,7 @@ export class AddonMessagesBlockContactUserHandler implements CoreUserProfileHand
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.updateButton(userId, {
|
this.updateButton(userId, {
|
||||||
title: 'addon.messages.blockcontact',
|
title: 'addon.messages.blockuser',
|
||||||
class: 'addon-messages-blockcontact-handler',
|
class: 'addon-messages-blockcontact-handler',
|
||||||
icon: 'close-circle',
|
icon: 'close-circle',
|
||||||
hidden: false,
|
hidden: false,
|
||||||
|
|
|
@ -132,9 +132,9 @@
|
||||||
"addon.files.sitefiles": "Site files",
|
"addon.files.sitefiles": "Site files",
|
||||||
"addon.messageoutput_airnotifier.processorsettingsdesc": "Configure devices",
|
"addon.messageoutput_airnotifier.processorsettingsdesc": "Configure devices",
|
||||||
"addon.messages.addcontact": "Add contact",
|
"addon.messages.addcontact": "Add contact",
|
||||||
"addon.messages.blockcontact": "Block contact",
|
|
||||||
"addon.messages.blockcontactconfirm": "You will no longer receive messages from this contact.",
|
|
||||||
"addon.messages.blocknoncontacts": "Prevent non-contacts from messaging me",
|
"addon.messages.blocknoncontacts": "Prevent non-contacts from messaging me",
|
||||||
|
"addon.messages.blockuser": "Block user",
|
||||||
|
"addon.messages.blockuserconfirm": "Are you sure you want to block {{$a}}?",
|
||||||
"addon.messages.contactableprivacy": "Accept messages from:",
|
"addon.messages.contactableprivacy": "Accept messages from:",
|
||||||
"addon.messages.contactableprivacy_coursemember": "My contacts and anyone in my courses",
|
"addon.messages.contactableprivacy_coursemember": "My contacts and anyone in my courses",
|
||||||
"addon.messages.contactableprivacy_onlycontacts": "My contacts only",
|
"addon.messages.contactableprivacy_onlycontacts": "My contacts only",
|
||||||
|
@ -163,7 +163,8 @@
|
||||||
"addon.messages.type_online": "Online",
|
"addon.messages.type_online": "Online",
|
||||||
"addon.messages.type_search": "Search results",
|
"addon.messages.type_search": "Search results",
|
||||||
"addon.messages.type_strangers": "Others",
|
"addon.messages.type_strangers": "Others",
|
||||||
"addon.messages.unblockcontact": "Unblock contact",
|
"addon.messages.unblockuser": "Unblock user",
|
||||||
|
"addon.messages.unblockuserconfirm": "Are you sure you want to unblock {{$a}}?",
|
||||||
"addon.messages.warningmessagenotsent": "Couldn't send message(s) to user {{user}}. {{error}}",
|
"addon.messages.warningmessagenotsent": "Couldn't send message(s) to user {{user}}. {{error}}",
|
||||||
"addon.mod_assign.acceptsubmissionstatement": "Please accept the submission statement.",
|
"addon.mod_assign.acceptsubmissionstatement": "Please accept the submission statement.",
|
||||||
"addon.mod_assign.addattempt": "Allow another attempt",
|
"addon.mod_assign.addattempt": "Allow another attempt",
|
||||||
|
|
Loading…
Reference in New Issue