parent
b4f99af291
commit
8b7d673942
|
@ -26,6 +26,7 @@ struct LiveRoomNormalChat: LiveRoomChat {
|
|||
}
|
||||
|
||||
struct LiveRoomDonationChat: LiveRoomChat {
|
||||
let memberId: Int
|
||||
let profileUrl: String
|
||||
let nickname: String
|
||||
let chat: String
|
||||
|
|
|
@ -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) :
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue