mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 11:45:19 +00:00
Add debug logging for room message routing
- Log when sending messages with room context - Log when receiving room vs main chat messages - Helps diagnose if room field is being properly transmitted
This commit is contained in:
@@ -264,6 +264,7 @@ class ChatViewModel: ObservableObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Send via mesh with mentions and room
|
// Send via mesh with mentions and room
|
||||||
|
print("[DEBUG] Sending message with room: \(messageRoom ?? "nil"), content: \(content)")
|
||||||
meshService.sendMessage(content, mentions: mentions, room: messageRoom)
|
meshService.sendMessage(content, mentions: mentions, room: messageRoom)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -657,6 +658,7 @@ extension ChatViewModel: BitchatDelegate {
|
|||||||
}
|
}
|
||||||
} else if let room = message.room {
|
} else if let room = message.room {
|
||||||
// Room message
|
// Room message
|
||||||
|
print("[DEBUG] Received room message for room: \(room), content: \(message.content)")
|
||||||
|
|
||||||
// Auto-join room if we see a message for it
|
// Auto-join room if we see a message for it
|
||||||
if !joinedRooms.contains(room) {
|
if !joinedRooms.contains(room) {
|
||||||
@@ -684,6 +686,7 @@ extension ChatViewModel: BitchatDelegate {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Regular public message (main chat)
|
// Regular public message (main chat)
|
||||||
|
print("[DEBUG] Received main chat message, no room specified. Content: \(message.content)")
|
||||||
messages.append(message)
|
messages.append(message)
|
||||||
// Sort messages by timestamp to ensure proper ordering
|
// Sort messages by timestamp to ensure proper ordering
|
||||||
messages.sort { $0.timestamp < $1.timestamp }
|
messages.sort { $0.timestamp < $1.timestamp }
|
||||||
|
|||||||
Reference in New Issue
Block a user