fix: resolve all remaining audit failures across rust, svelte, and java
This commit is contained in:
1 parent
bc12a25a01
commit
590178e41a
35 files changed
+958
-300
No files matched your search
@@ -179,7 +179,7 @@
|
||||
<div class="guild-info">
|
||||
<div class="guild-title-line">
|
||||
<h2>{myGuild.name}</h2>
|
||||
<span class="badge member-badge"><Users size={12} /> {myGuild.member_count} / {myGuild.max_members} Members</span>
|
||||
<span class="badge member-badge"><Users size={12} /> {myGuild.member_count} Members</span>
|
||||
<span class="badge claim-badge"><Shield size={12} /> {myGuild.claims_count} Claims</span>
|
||||
</div>
|
||||
{#if myGuild.description}
|
||||
@@ -228,23 +228,23 @@
|
||||
{:else if activeTab === 'members'}
|
||||
<div class="members-tab">
|
||||
<div class="members-grid">
|
||||
{#each members as m (m.user_uuid)}
|
||||
{#each members as m (m.uuid)}
|
||||
<div
|
||||
class="member-card glass"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
onclick={() => (app.viewProfileUuid = m.user_uuid)}
|
||||
onkeydown={(e) => e.key === 'Enter' && (app.viewProfileUuid = m.user_uuid)}
|
||||
onclick={() => (app.viewProfileUuid = m.uuid)}
|
||||
onkeydown={(e) => e.key === 'Enter' && (app.viewProfileUuid = m.uuid)}
|
||||
>
|
||||
<div class="member-avatar-wrap">
|
||||
<Avatar uuid={m.user_uuid} name={m.username} size={2.5} />
|
||||
{#if m.is_online}
|
||||
<Avatar uuid={m.uuid} name={m.name} size={2.5} />
|
||||
{#if m.online}
|
||||
<span class="online-indicator" title="Online"></span>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="member-details">
|
||||
<div class="member-name-row">
|
||||
<span class="member-name">{m.username}</span>
|
||||
<span class="member-name">{m.name}</span>
|
||||
{#if m.role === 'leader'}
|
||||
<span class="badge leader-badge"><Crown size={11} /> Leader</span>
|
||||
{:else if m.role === 'officer'}
|
||||
|
||||
@@ -408,7 +408,7 @@
|
||||
{#if skinProfiles.length}
|
||||
<div class="profiles-grid">
|
||||
{#each skinProfiles as sp (sp.id)}
|
||||
{@const isCurrent = profile.skin_model === sp.skin_model && (sp.cape_id === (profile.cape?.id ?? null))}
|
||||
{@const isCurrent = !!sp.skin_data && sp.skin_data === profile.skin_url && profile.skin_model === sp.skin_model && sp.cape_id === (profile.cape?.id ?? null)}
|
||||
<div class="profile-card" class:active-look={isCurrent}>
|
||||
<div class="profile-preview">
|
||||
<SkinView skin={sp.skin_data} cape={sp.cape_url} slim={sp.skin_model === 'slim'} side="front" scale={3.5} />
|
||||
|
||||
@@ -141,7 +141,7 @@
|
||||
const text = messageInput.trim();
|
||||
try {
|
||||
const msg = await invoke<DirectMessage>('send_direct_message', {
|
||||
toUuid: activeChatFriend.uuid,
|
||||
friendUuid: activeChatFriend.uuid,
|
||||
content: text
|
||||
});
|
||||
messages = [...messages, msg];
|
||||
@@ -162,12 +162,12 @@
|
||||
if (!inviteTargetFriend) return;
|
||||
sendingInvite = true;
|
||||
try {
|
||||
const inst = instances().find((i) => i.id === inviteInstanceId);
|
||||
// FIX #14: The Rust command takes recipient_uuid, instance_id, server_id (optional i64).
|
||||
// serverAddress/serverName were wrong fields that the command doesn't accept.
|
||||
await invoke('send_game_invite', {
|
||||
toUuid: inviteTargetFriend.uuid,
|
||||
recipientUuid: inviteTargetFriend.uuid,
|
||||
instanceId: inviteInstanceId,
|
||||
serverAddress: inst?.server?.address ?? 'localhost',
|
||||
serverName: inst?.name ?? 'Minecraft Server'
|
||||
serverId: null // Optional; pass a server_id i64 here if the instance has a known server.
|
||||
});
|
||||
toast(`Game invite sent to ${inviteTargetFriend.username}!`, 'ok');
|
||||
inviteModalOpen = false;
|
||||
@@ -191,12 +191,12 @@
|
||||
}
|
||||
|
||||
const acceptedFriends = $derived(friends.filter((f) => f.status === 'accepted'));
|
||||
const pendingReceived = $derived(friends.filter((f) => f.status === 'pending_received'));
|
||||
const pendingSent = $derived(friends.filter((f) => f.status === 'pending_sent'));
|
||||
const pendingReceived = $derived(friends.filter((f) => f.status === 'pending_incoming'));
|
||||
const pendingSent = $derived(friends.filter((f) => f.status === 'pending_outgoing'));
|
||||
|
||||
const displayedFriends = $derived(
|
||||
friends.filter((f) => {
|
||||
if (friendsFilter === 'online') return f.status === 'accepted' && f.is_online;
|
||||
if (friendsFilter === 'online') return f.status === 'accepted' && f.online;
|
||||
if (friendsFilter === 'pending') return f.status !== 'accepted';
|
||||
return f.status === 'accepted';
|
||||
})
|
||||
@@ -267,7 +267,7 @@
|
||||
All ({acceptedFriends.length})
|
||||
</button>
|
||||
<button class="pill" class:active={friendsFilter === 'online'} onclick={() => (friendsFilter = 'online')}>
|
||||
Online ({acceptedFriends.filter((f) => f.is_online).length})
|
||||
Online ({acceptedFriends.filter((f) => f.online).length})
|
||||
</button>
|
||||
<button class="pill" class:active={friendsFilter === 'pending'} onclick={() => (friendsFilter = 'pending')}>
|
||||
Pending ({pendingReceived.length + pendingSent.length})
|
||||
@@ -355,13 +355,13 @@
|
||||
>
|
||||
<div class="avatar-holder">
|
||||
<Avatar uuid={friend.uuid} name={friend.username} size={2.6} />
|
||||
<span class="status-dot" class:online={friend.is_online}></span>
|
||||
<span class="status-dot" class:online={friend.online}></span>
|
||||
</div>
|
||||
<div class="name-block">
|
||||
<span class="user-title">{friend.username}</span>
|
||||
{#if friend.is_online && friend.playing_on}
|
||||
{#if friend.online && friend.playing_on}
|
||||
<span class="tiny playing-on">Playing on {friend.playing_on}</span>
|
||||
{:else if friend.is_online}
|
||||
{:else if friend.online}
|
||||
<span class="tiny online-label">Online in Launcher</span>
|
||||
{:else}
|
||||
<span class="tiny muted">Offline</span>
|
||||
@@ -494,7 +494,7 @@
|
||||
>
|
||||
<div class="avatar-holder">
|
||||
<Avatar uuid={friend.uuid} name={friend.username} size={2} />
|
||||
<span class="status-dot" class:online={friend.is_online}></span>
|
||||
<span class="status-dot" class:online={friend.online}></span>
|
||||
</div>
|
||||
<div class="conv-meta">
|
||||
<span class="conv-name">{friend.username}</span>
|
||||
@@ -521,7 +521,7 @@
|
||||
<Avatar uuid={activeChatFriend.uuid} name={activeChatFriend.username} size={2.2} />
|
||||
<div>
|
||||
<strong>{activeChatFriend.username}</strong>
|
||||
<span class="tiny muted block">{activeChatFriend.is_online ? 'Active now' : 'Offline'}</span>
|
||||
<span class="tiny muted block">{activeChatFriend.online ? 'Active now' : 'Offline'}</span>
|
||||
</div>
|
||||
</div>
|
||||
<button class="primary sm" onclick={() => openInviteModal(activeChatFriend!)}>
|
||||
@@ -537,7 +537,7 @@
|
||||
</div>
|
||||
{:else}
|
||||
{#each messages as msg (msg.id)}
|
||||
{@const isMine = msg.from_uuid === activeAccount()?.uuid}
|
||||
{@const isMine = msg.sender_uuid === activeAccount()?.uuid}
|
||||
<div class="bubble-row" class:is-mine={isMine}>
|
||||
<div class="bubble" class:is-mine={isMine}>
|
||||
<p class="bubble-text">{msg.content}</p>
|
||||
@@ -586,11 +586,11 @@
|
||||
{#each invites as inv (inv.id)}
|
||||
<div class="invite-card glass">
|
||||
<div class="invite-top">
|
||||
<Avatar uuid={inv.from_uuid} name={inv.from_username} size={2.5} />
|
||||
<Avatar uuid={inv.sender_uuid} name={inv.sender_name} size={2.5} />
|
||||
<div class="invite-meta">
|
||||
<span class="inviter-name"><strong>{inv.from_username}</strong> invited you to play</span>
|
||||
<span class="inviter-name"><strong>{inv.sender_name}</strong> invited you to play</span>
|
||||
<span class="server-title">{inv.server_name}</span>
|
||||
<span class="tiny muted server-addr">{inv.server_address}</span>
|
||||
<span class="tiny muted server-addr">{inv.instance_name}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="invite-footer">
|
||||
|
||||
Reference in new issue
Block a user