- Accepted and Refused Group Entering
- Report a User
This commit is contained in:
@@ -4671,6 +4671,22 @@ export const tools = {
|
||||
})
|
||||
},
|
||||
|
||||
reportUser($q: any, username: string, usernameDest: string) { // Segnala Profilo
|
||||
const userStore = useUserStore()
|
||||
$q.dialog({
|
||||
message: t('db.domanda_reportuser', { username: usernameDest }),
|
||||
ok: { label: t('dialog.yes'), push: true },
|
||||
cancel: { label: t('dialog.cancel') },
|
||||
title: t('db.domanda')
|
||||
}).onOk(() => {
|
||||
userStore.setFriendsCmd($q, t, username, usernameDest, shared_consts.FRIENDSCMD.REPORT_USER, null).then((res: any) => {
|
||||
if (res) {
|
||||
tools.showPositiveNotif($q, t('db.reporteduser'))
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
refuseReqFriends($q: any, username: string, usernameDest: string) {
|
||||
|
||||
const userStore = useUserStore()
|
||||
@@ -4696,6 +4712,7 @@ export const tools = {
|
||||
addToMyGroups($q: any, username: string, groupnameDest: string) {
|
||||
|
||||
const userStore = useUserStore()
|
||||
const notifStore = useNotifStore()
|
||||
$q.dialog({
|
||||
message: t('db.domanda_addtogroup', { username, groupname: groupnameDest }),
|
||||
ok: { label: t('dialog.yes'), push: true },
|
||||
@@ -4703,9 +4720,10 @@ export const tools = {
|
||||
title: t('db.domanda')
|
||||
}).onOk(() => {
|
||||
|
||||
userStore.setGroupsCmd($q, t, username, groupnameDest, shared_consts.GROUPSCMD.SETGROUP, null)
|
||||
userStore.setGroupsCmd($q, t, username, groupnameDest, shared_consts.GROUPSCMD.SETGROUP, true)
|
||||
.then((res: any) => {
|
||||
if (res) {
|
||||
notifStore.updateNotification = true
|
||||
if (userStore.my.profile.mygroups)
|
||||
userStore.my.profile.mygroups = [...userStore.my.profile.mygroups, res]
|
||||
else
|
||||
@@ -4716,6 +4734,27 @@ export const tools = {
|
||||
})
|
||||
},
|
||||
|
||||
refuseReqGroup($q: any, username: string, groupnameDest: string) {
|
||||
|
||||
const userStore = useUserStore()
|
||||
const notifStore = useNotifStore()
|
||||
$q.dialog({
|
||||
message: t('db.domanda_revoke_group', { groupname: groupnameDest }),
|
||||
ok: { label: t('dialog.yes'), push: true },
|
||||
cancel: { label: t('dialog.cancel') },
|
||||
title: t('db.domanda')
|
||||
}).onOk(() => {
|
||||
|
||||
userStore.setGroupsCmd($q, t, username, groupnameDest, shared_consts.GROUPSCMD.REFUSE_REQ_GROUP, null).then((res) => {
|
||||
if (res) {
|
||||
notifStore.updateNotification = true
|
||||
userStore.my.profile.asked_groups = userStore.my.profile.asked_groups.filter((rec: IMyGroup) => rec.groupname !== groupnameDest)
|
||||
tools.showPositiveNotif($q, t('db.refusedgroup'))
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
blockGroup($q: any, username: string, usernameDest: string) {
|
||||
const userStore = useUserStore()
|
||||
|
||||
@@ -5063,6 +5102,8 @@ export const tools = {
|
||||
tools.addToMyGroups($q, username, dest)
|
||||
} else if (cmd === shared_consts.GROUPSCMD.REQGROUP) {
|
||||
tools.setRequestGroup($q, username, dest, value)
|
||||
} else if (cmd === shared_consts.GROUPSCMD.REFUSE_REQ_GROUP) {
|
||||
tools.refuseReqGroup($q, username, dest)
|
||||
} else if (cmd === shared_consts.GROUPSCMD.CANCEL_REQ_GROUP) {
|
||||
tools.cancelReqGroups($q, username, dest)
|
||||
} else if (cmd === shared_consts.FRIENDSCMD.REMOVE_FROM_MYFRIENDS) {
|
||||
|
||||
Reference in New Issue
Block a user