mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-06 22:46:06 +02:00
Did group leave or did not leave? hm?
This commit is contained in:
@@ -423,8 +423,7 @@ function handlePipeline(args) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'group-left':
|
case 'group-left':
|
||||||
// var groupId = content.groupId;
|
groupStore.onGroupLeft(content.groupId);
|
||||||
// $app.onGroupLeft(groupId);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'group-role-updated':
|
case 'group-role-updated':
|
||||||
|
|||||||
+16
-12
@@ -344,22 +344,25 @@ export const useGroupStore = defineStore('Group', () => {
|
|||||||
*
|
*
|
||||||
* @param {string} groupId
|
* @param {string} groupId
|
||||||
*/
|
*/
|
||||||
function onGroupLeft(groupId) {
|
async function onGroupLeft(groupId) {
|
||||||
|
const args = await groupRequest.getGroup({ groupId });
|
||||||
|
const ref = applyGroup(args.json);
|
||||||
|
if (ref.membershipStatus === 'member') {
|
||||||
|
// wtf, not trusting presence
|
||||||
|
console.error(
|
||||||
|
`onGroupLeft: presence lied, still a member of ${groupId}`
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (groupDialog.value.visible && groupDialog.value.id === groupId) {
|
if (groupDialog.value.visible && groupDialog.value.id === groupId) {
|
||||||
showGroupDialog(groupId);
|
showGroupDialog(groupId);
|
||||||
}
|
}
|
||||||
if (currentUserGroups.has(groupId)) {
|
if (currentUserGroups.has(groupId)) {
|
||||||
currentUserGroups.delete(groupId);
|
currentUserGroups.delete(groupId);
|
||||||
groupRequest.getCachedGroup({ groupId }).then((args) => {
|
groupChange(ref, 'Left group');
|
||||||
if (args.ref?.ownerId === userStore.currentUser.id) {
|
|
||||||
// Issue #1455
|
// delay to wait for json to be assigned to ref
|
||||||
console.log(
|
workerTimers.setTimeout(saveCurrentUserGroups, 100);
|
||||||
`Not sending left group notification for owned group ${groupId}`
|
|
||||||
);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
groupChange(args.ref, 'Left group');
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1096,6 +1099,7 @@ export const useGroupStore = defineStore('Group', () => {
|
|||||||
handleGroupList,
|
handleGroupList,
|
||||||
handleGroupRepresented,
|
handleGroupRepresented,
|
||||||
showModerateGroupDialog,
|
showModerateGroupDialog,
|
||||||
showGroupMemberModerationDialog
|
showGroupMemberModerationDialog,
|
||||||
|
onGroupLeft
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user