mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-06-19 00:45:33 +10:00
add icon, also misc improvments
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
class ReactionInfo {
|
||||
final String targetMessageId;
|
||||
final String emoji;
|
||||
|
||||
ReactionInfo({
|
||||
required this.targetMessageId,
|
||||
required this.emoji,
|
||||
});
|
||||
}
|
||||
|
||||
class ReactionHelper {
|
||||
/// Parse reaction format: r:[messageId]:[emoji]
|
||||
static ReactionInfo? parseReaction(String text) {
|
||||
final regex = RegExp(r'^r:([^:]+):(.+)$');
|
||||
final match = regex.firstMatch(text);
|
||||
if (match == null) return null;
|
||||
return ReactionInfo(
|
||||
targetMessageId: match.group(1)!,
|
||||
emoji: match.group(2)!,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user