diff --git a/SodaLive/Sources/Live/Room/Chat/LiveRoomChat.swift b/SodaLive/Sources/Live/Room/Chat/LiveRoomChat.swift index 8af0bcc..3c72115 100644 --- a/SodaLive/Sources/Live/Room/Chat/LiveRoomChat.swift +++ b/SodaLive/Sources/Live/Room/Chat/LiveRoomChat.swift @@ -26,6 +26,7 @@ struct LiveRoomNormalChat: LiveRoomChat { } struct LiveRoomDonationChat: LiveRoomChat { + let memberId: Int let profileUrl: String let nickname: String let chat: String diff --git a/SodaLive/Sources/Live/Room/Chat/LiveRoomDonationChatItemView.swift b/SodaLive/Sources/Live/Room/Chat/LiveRoomDonationChatItemView.swift index 45cf2ae..b1e8fe6 100644 --- a/SodaLive/Sources/Live/Room/Chat/LiveRoomDonationChatItemView.swift +++ b/SodaLive/Sources/Live/Room/Chat/LiveRoomDonationChatItemView.swift @@ -50,7 +50,7 @@ struct LiveRoomDonationChatItemView: View { .font(.system(size: 15)) .foregroundColor(Color(hex: "fdca2f")) - Text(chatMessage.chat.contains("비밀") ? "으로 비밀미션을 보냈습니다.💰🪙" : "을 후원하셨습니다.💰🪙") + Text(chatMessage.chat.contains("비밀") ? "으로 비밀미션을 보냈습니다." : "을 후원하셨습니다.💰🪙") .font(.system(size: 15)) .foregroundColor(.white) } @@ -65,7 +65,8 @@ struct LiveRoomDonationChatItemView: View { .padding(13) .frame(width: screenSize().width - 86, alignment: .leading) .background( - chatMessage.chat.contains("비밀") ? Color(hex: "333333").opacity(0.8) : + chatMessage.chat.contains("비밀") ? chatMessage.memberId == UserDefaults.int(forKey: .userId) ? Color(hex: "59548f").opacity(0.8) : + Color(hex: "333333").opacity(0.8) : chatMessage.can >= 10000 ? Color(hex: "c25264").opacity(0.8) : chatMessage.can >= 5000 ? Color(hex: "d85e37").opacity(0.8) : chatMessage.can >= 1000 ? Color(hex: "d38c38").opacity(0.8) : diff --git a/SodaLive/Sources/Live/Room/LiveRoomViewModel.swift b/SodaLive/Sources/Live/Room/LiveRoomViewModel.swift index 70014ef..71024e9 100644 --- a/SodaLive/Sources/Live/Room/LiveRoomViewModel.swift +++ b/SodaLive/Sources/Live/Room/LiveRoomViewModel.swift @@ -495,6 +495,7 @@ final class LiveRoomViewModel: NSObject, ObservableObject { let (nickname, profileUrl) = self.getUserNicknameAndProfileUrl(accountId: UserDefaults.int(forKey: .userId)) self.messages.append( LiveRoomDonationChat( + memberId: UserDefaults.int(forKey: .userId), profileUrl: profileUrl, nickname: nickname, chat: rawMessage, @@ -525,6 +526,7 @@ final class LiveRoomViewModel: NSObject, ObservableObject { let (nickname, profileUrl) = self.getUserNicknameAndProfileUrl(accountId: UserDefaults.int(forKey: .userId)) self.messages.append( LiveRoomDonationChat( + memberId: UserDefaults.int(forKey: .userId), profileUrl: profileUrl, nickname: nickname, chat: rawMessage, @@ -2192,6 +2194,7 @@ extension LiveRoomViewModel: AgoraRtmDelegate { if decoded.type == .SECRET_DONATION { self.messages.append( LiveRoomDonationChat( + memberId: Int(peerId)!, profileUrl: profileUrl, nickname: nickname, chat: decoded.message, @@ -2225,6 +2228,7 @@ extension LiveRoomViewModel: AgoraRtmChannelDelegate { if decoded.type == .DONATION { self.messages.append( LiveRoomDonationChat( + memberId: Int(member.userId)!, profileUrl: profileUrl, nickname: nickname, chat: decoded.message,