-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Added SystemMessagePinnedMessage
contentType
#10496
Conversation
Jenkins BuildsClick to see older builds (17)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It wasn't part of the ticket, but making it resilient to future crashes would be great
@@ -204,6 +204,8 @@ Loader { | |||
return fetchMoreMessagesButtonComponent | |||
case Constants.messageContentType.systemMessagePrivateGroupType: | |||
return privateGroupHeaderComponent | |||
case Constants.messageContentType.systemMessagePinnedMessage: | |||
return null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it was crashing because we were trying to create a messageCompoennt
when it was actually a systemMessagePinnedMessage
?
If that's the case, we'll have crashes each time a new MessageType is added.
So we should make the default
return null
, because then we just show nothing because we didn't implement it yet, and we need to explicitly list the types that should use messageComponent
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was crashing on the Nim side in the code like message.contentType.ContentType
. I.e. when trying to convert integer to enum
. 😐
I agree that it would be great fix that on another level, but thought that it's not easy to implement.
But didn't check that. Let me take a look 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modulo what Jo said about the default returning null
About the Further UI implementation is tracked here: #10495 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice fix on the System message.
Are you planning on returning null
like I suggested or do we add another issue?
It should be simple, just default
to null
and list all the types that use messageComponent
?
@jrainville I'm currently adding a robust fix fix for Nim side to check the content type when converting to enum. |
Enum fix is pushed. Will quickly implement |
ok, there we are. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much better!
And robust 🤣
Seriously now, much better
@@ -138,7 +139,7 @@ proc toDiscordMessageAuthor*(jsonObj: JsonNode): DiscordMessageAuthor = | |||
discard jsonObj.getProp("localUrl", result.localUrl) | |||
|
|||
|
|||
proc toDiscordMessageAttachment*(jsonObj: JsonNOde): DiscordMessageAttachment = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ROFL! What the actual...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When are we getting rid of this NIM nonsense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's go 👏
return messageComponent | ||
case Constants.messageContentType.unknownContentType: | ||
// NOTE: We could display smth like "unknown message type, please upgrade Status to see it". | ||
return null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you remove the return, as it would use the default
one instead, but I could be wrong. Anyway, it's not important
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I know, I added it explicitly because with this comment it looked quite strange without a ’return’ 😑
Fixes #10485
What does the PR do
This PR addresses a change made in status-im/status-go#3414.
I simply added the new
ContentType
so that it could be correctly processed.Also, I hided the reply with
ContentType=14
.Opened a further request: #10495
Affected areas
Chat