fix: own messages from native did not show custom emojis#220
Conversation
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
Disabled knowledge base sources:
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe change expands LINE inline sticon detection and conversion. It parses plaintext and encrypted metadata, reconstructs EMTVER3/4 resources, tries multiple CDN URLs, uploads valid images, and renders custom emoji with integration coverage. ChangesInline sticon conversion
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant convertLineMessage
participant ConvertInlineEmoji
participant LINECDN
participant Matrix
convertLineMessage->>ConvertInlineEmoji: detect validated REPLACE sticon metadata
ConvertInlineEmoji->>LINECDN: request candidate image URLs
LINECDN-->>ConvertInlineEmoji: return image bytes or failure
ConvertInlineEmoji->>Matrix: upload image media
Matrix-->>ConvertInlineEmoji: return uploaded media URI
Possibly related PRs
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
| } | ||
|
|
||
| func sticonProductHash(productCode rune) string { | ||
| sum := md5.Sum([]byte(fmt.Sprintf("%X", productCode))) |
There was a problem hiding this comment.
Uppercase-hex MD5 input may not match Chrome: fmt.Sprintf("%X", productCode) produces "1001AB" for a product rune like U+1001AB. If Chrome's real derivation hashes the lowercase representation (%x → "1001ab"), the two MD5s differ and the resulting CDN URL 404s for any EMTVER4 product whose code point contains hex letters (A–F). The existing tests only exercise 0x100101, which is all digits, so this wouldn't surface. Worth verifying against a Chrome capture that includes a product rune with a hex-letter nibble; if lowercase is correct, switch both this and the SticonID formatting on lines 479/496 to %x.
| return resources | ||
| } | ||
|
|
||
| func appendUniqueSticonResources(dst, src []SticonResource) []SticonResource { |
There was a problem hiding this comment.
Dedup key is Start only: If body/metadata declare a resource at Start=X with product A, and deriveSticonResources also produces Start=X with product B, the derived entry is dropped without a mismatch warning. This is intentional ("explicit wins") and correct when the sources agree on the visible token, but there's no invariant enforced — mismatched sender data would silently pick the earlier source. Consider logging when a duplicate Start carries different Product/Sticon IDs so future regressions surface, or documenting the assumption explicitly.
No description provided.