Skip to content

Rich Text Editor events #80

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 2 additions & 54 deletions schemas/SlashCommand.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,60 +6,8 @@
"enum": ["SlashCommand"]
},
"command": {
"description": "The name of this command.",
"type": "string",
"enum": [
"Spoiler",
"Shrug",
"TableFlip",
"Unflip",
"Lenny",
"Plain",
"Html",
"UpgradeRoom",
"JumpToDate",
"Nick",
"MyRoomNick",
"RoomAvatar",
"MyRoomAvatar",
"MyAvatar",
"Topic",
"RoomName",
"Invite",
"Join",
"Part",
"Remove",
"Ban",
"Unban",
"Ignore",
"Unignore",
"Op",
"Deop",
"DevTools",
"AddWidget",
"Verify",
"DiscardSession",
"RemakeOlm",
"Rainbow",
"RainbowMe",
"Help",
"Whois",
"Rageshake",
"ToVirtual",
"Query",
"Msg",
"HoldCall",
"UnholdCall",
"ConvertToDM",
"ConvertToRoom",
"Me",
"Confetti",
"Fireworks",
"Hearts",
"Rainfall",
"Snowfall",
"SpaceInvaders"
]
"description": "The the slash command text. e.g. /me ",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this make sense @t3chguy ?

So you might nee update any reports you have that use the old format(Part/Invite)?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm good point, losing historical data would not be good. Not sure what the best solution is here then.

"type": "string"
},
"editor": {
"description": "Whether this message was composed in legacy editor, the new the rich text editor or the new plain text editor",
Expand Down
60 changes: 2 additions & 58 deletions types/kotlin/SlashCommand.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ package quicktype
*/
data class SlashCommand (
/**
* The name of this command.
* The the slash command text. e.g. /me
*/
val command: Command,
val command: String,

/**
* Whether this message was composed in legacy editor, the new the rich text editor or the
Expand All @@ -18,62 +18,6 @@ data class SlashCommand (
val eventName: EventName
)

/**
* The name of this command.
*/
enum class Command {
AddWidget,
Ban,
Confetti,
ConvertToDM,
ConvertToRoom,
Deop,
DevTools,
DiscardSession,
Fireworks,
HTML,
Hearts,
Help,
HoldCall,
Ignore,
Invite,
Join,
JumpToDate,
Lenny,
Me,
Msg,
MyAvatar,
MyRoomAvatar,
MyRoomNick,
Nick,
Op,
Part,
Plain,
Query,
Rageshake,
Rainbow,
RainbowMe,
Rainfall,
RemakeOlm,
Remove,
RoomAvatar,
RoomName,
Shrug,
Snowfall,
SpaceInvaders,
Spoiler,
TableFlip,
ToVirtual,
Topic,
Unban,
Unflip,
UnholdCall,
Unignore,
UpgradeRoom,
Verify,
Whois
}

/**
* Whether this message was composed in legacy editor, the new the rich text editor or the
* new plain text editor
Expand Down
59 changes: 3 additions & 56 deletions types/kotlin2/SlashCommand.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,69 +26,16 @@ import im.vector.app.features.analytics.itf.VectorAnalyticsEvent
*/
data class SlashCommand(
/**
* The name of this command.
* The the slash command text. e.g. /me
*/
val command: Command,
val command: String,
/**
* Whether this message was composed in legacy editor, the new the rich
* text editor or the new plain text editor
*/
val editor: Editor,
) : VectorAnalyticsEvent {

enum class Command {
AddWidget,
Ban,
Confetti,
ConvertToDM,
ConvertToRoom,
Deop,
DevTools,
DiscardSession,
Fireworks,
Hearts,
Help,
HoldCall,
Html,
Ignore,
Invite,
Join,
JumpToDate,
Lenny,
Me,
Msg,
MyAvatar,
MyRoomAvatar,
MyRoomNick,
Nick,
Op,
Part,
Plain,
Query,
Rageshake,
Rainbow,
RainbowMe,
Rainfall,
RemakeOlm,
Remove,
RoomAvatar,
RoomName,
Shrug,
Snowfall,
SpaceInvaders,
Spoiler,
TableFlip,
ToVirtual,
Topic,
Unban,
Unflip,
UnholdCall,
Unignore,
UpgradeRoom,
Verify,
Whois,
}

enum class Editor {
Legacy,
RteFormatting,
Expand All @@ -99,7 +46,7 @@ data class SlashCommand(

override fun getProperties(): Map<String, Any>? {
return mutableMapOf<String, Any>().apply {
put("command", command.name)
put("command", command)
put("editor", editor.name)
}.takeIf { it.isNotEmpty() }
}
Expand Down
61 changes: 4 additions & 57 deletions types/swift/SlashCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,69 +24,16 @@ extension AnalyticsEvent {
public struct SlashCommand: AnalyticsEventProtocol {
public let eventName = "SlashCommand"

/// The name of this command.
public let command: Command
/// The the slash command text. e.g. /me
public let command: String
/// Whether this message was composed in legacy editor, the new the rich text editor or the new plain text editor
public let editor: Editor

public init(command: Command, editor: Editor) {
public init(command: String, editor: Editor) {
self.command = command
self.editor = editor
}

public enum Command: String {
case AddWidget
case Ban
case Confetti
case ConvertToDM
case ConvertToRoom
case Deop
case DevTools
case DiscardSession
case Fireworks
case Hearts
case Help
case HoldCall
case Html
case Ignore
case Invite
case Join
case JumpToDate
case Lenny
case Me
case Msg
case MyAvatar
case MyRoomAvatar
case MyRoomNick
case Nick
case Op
case Part
case Plain
case Query
case Rageshake
case Rainbow
case RainbowMe
case Rainfall
case RemakeOlm
case Remove
case RoomAvatar
case RoomName
case Shrug
case Snowfall
case SpaceInvaders
case Spoiler
case TableFlip
case ToVirtual
case Topic
case Unban
case Unflip
case UnholdCall
case Unignore
case UpgradeRoom
case Verify
case Whois
}

public enum Editor: String {
case Legacy
case RteFormatting
Expand All @@ -95,7 +42,7 @@ extension AnalyticsEvent {

public var properties: [String: Any] {
return [
"command": command.rawValue,
"command": command,
"editor": editor.rawValue
]
}
Expand Down