{originsExpanded && originsCount > 0 && (
-
- {origins.map((origin, index) => (
-
- {origin}
-
- ))}
+
+ {originPathArray.map(([origin, path], index) => {
+ // Parse path into 2-character slices
+ const pathSlices = path.match(/.{1,2}/g) || [];
+ const formattedPath = pathSlices.join(' ');
+
+ return (
+
+ {origin}
+ {formattedPath}
+
+ );
+ })}
)}
diff --git a/src/lib/clickhouse/actions.ts b/src/lib/clickhouse/actions.ts
index e579712..e843d49 100644
--- a/src/lib/clickhouse/actions.ts
+++ b/src/lib/clickhouse/actions.ts
@@ -67,7 +67,7 @@ export async function getLatestChatMessages({ limit = 20, before, after, channel
params.channelId = channelId;
}
const whereClause = where.length > 0 ? `WHERE ${where.join(' AND ')}` : '';
- const query = `SELECT ingest_timestamp, origins, mesh_timestamp, path_len, path, channel_hash, mac, hex(encrypted_message) AS encrypted_message FROM meshcore_public_channel_messages ${whereClause} ORDER BY ingest_timestamp DESC LIMIT {limit:UInt32}`;
+ const query = `SELECT ingest_timestamp, origins, mesh_timestamp, path_len, channel_hash, mac, hex(encrypted_message) AS encrypted_message, message_count, origin_path_array FROM meshcore_public_channel_messages ${whereClause} ORDER BY ingest_timestamp DESC LIMIT {limit:UInt32}`;
const resultSet = await clickhouse.query({ query, query_params: params, format: 'JSONEachRow' });
const rows = await resultSet.json();
return rows as Array<{
@@ -75,10 +75,11 @@ export async function getLatestChatMessages({ limit = 20, before, after, channel
origins: string[];
mesh_timestamp: string;
path_len: number;
- path: string;
channel_hash: string;
mac: string;
encrypted_message: string;
+ message_count: number;
+ origin_path_array: Array<[string, string]>; // Array of [origin, path] tuples
}>;
} catch (error) {
console.error('ClickHouse error in getLatestChatMessages:', error);