feat: 2.3.1
This commit is contained in:
@@ -213,7 +213,7 @@ func get_dm_history(user_id: String, limit: int = 50) -> Array:
|
||||
var channel = await open_dm(user_id)
|
||||
if not channel:
|
||||
return []
|
||||
var result = await NakamaManager.client.list_channel_messages_async(NakamaManager.session, channel.id, limit, true)
|
||||
var result = await NakamaManager.client.list_channel_messages_async(NakamaManager.session, channel.id, limit, false)
|
||||
if result.is_exception():
|
||||
push_warning("[FriendManager] Failed to fetch DM history: " + result.get_exception().message)
|
||||
return []
|
||||
@@ -226,9 +226,9 @@ func get_dm_history(user_id: String, limit: int = 50) -> Array:
|
||||
text = parsed.get("msg", msg.content)
|
||||
else:
|
||||
text = msg.content
|
||||
history.append({"from": msg.sender_id, "msg": text, "username": msg.username})
|
||||
history.append({"from": msg.sender_id, "msg": text, "username": msg.username, "create_time": msg.create_time})
|
||||
|
||||
history.reverse() # Oldest to newest
|
||||
history.reverse() # API returns newest-first; flip to oldest-first so display is top=old, bottom=new
|
||||
return history
|
||||
|
||||
func send_dm(user_id: String, message: String) -> bool:
|
||||
@@ -249,6 +249,10 @@ func _on_channel_message(message) -> void:
|
||||
# Ignore global chat
|
||||
if "social_global" in message.channel_id:
|
||||
return
|
||||
|
||||
# Ignore messages sent by ourselves (we already add them locally instantly)
|
||||
if NakamaManager.session and message.sender_id == NakamaManager.session.user_id:
|
||||
return
|
||||
|
||||
var text: String = ""
|
||||
var parsed = JSON.parse_string(message.content)
|
||||
|
||||
Reference in New Issue
Block a user