QuickBlox / q-municate-android

Qmunicate Android chat application
MIT License
254 stars 197 forks source link

How to save custom data of qbchatdialog into orm db #313

Closed GoodyIT closed 1 year ago

GoodyIT commented 6 years ago

I am developing android chat app based on q-municate. I am going to use custom data of qbchatdialog, so that I can customize chat dialog for chat role management.

Now I can successfully fetch qbchatdialog list with custom data from the server which I made in iOS version. allDialogsListGroup.get(0) = {QBChatDialog@7524} chatService = {QBChatService@7556} currentChat = {QBGroupChat@7557} customData = {QBDialogCustomData@7558} className = "dialog_data" fields = {HashMap@7580} size = 4 0 = {HashMap$Node@7583} "role_admin" -> " size = 1" 1 = {HashMap$Node@7584} "role_reader" -> " size = 1" 2 = {HashMap$Node@7585} "tag" -> "Colleagues" 3 = {HashMap$Node@7586} "role_normal" -> " size = 4" createdAt = null id = null sdf = null updatedAt = null shadow$_klass_ = {Class@7436} "" shadow$_monitor_ = -2092225503 dialogId = "5a557c69a0eb4749a42eda1b" dialogMessageListener = {QBChatDialog$DialogMessageListener@7560} dialogMessageListeners = {CopyOnWriteArraySet@7561} size = 0 dialogMessageSentListeners = {CopyOnWriteArraySet@7562} size = 0 dialogParticipantListeners = {CopyOnWriteArraySet@7563} size = 0 dialogTypingListeners = {CopyOnWriteArraySet@7564} size = 0 lastMessage = "kk" lastMessageDateSent = 1533422454 lastMessageUserId = {Integer@7566} 30195299 messageSentListener = {QBChatDialog$MessageSentListener@7567} name = "Ho Thong Mee, Ho Yan Hong, Jason Waff, Jill Ho, Jing Piow" occupantsIds = {ArrayList@7569} size = 4 participantListener = {QBChatDialog$ParticipantListener@7570} photo = null roomJid = "55869_5a557c69a0eb4749a42eda1b@muc.chat.quickblox.com" type = {Integer@7572} 2 typingListener = {QBChatDialog$IsTypingListener@7573} unreadMessageCount = {Integer@7574} 0 userId = {Integer@7575} 30195299 createdAt = {Date@7576} id = null sdf = {SimpleDateFormat@7577} updatedAt = {Date@7578} shadow$_klass_ = {Class@7438} "" shadow$_monitor_ = -1950660463

As listed, there is custom data for QBchatdialog, but the problem is that I cannot save this custom data into dao database since Dialog class does not have "custom data" field.

I try to add new field for custom data, but I am kind of new to orm dao, so I couldn't

I already spent a few days to fix it and I need to get this done asap. Please review and help me.

If you need any more info, I can provide that. as of now I don't know what to post.

Regards