diff --git a/SharpChat/EventStorage/MariaDBEventStorage_Migrations.cs b/SharpChat/EventStorage/MariaDBEventStorage_Migrations.cs index f050b3b..b780a9d 100644 --- a/SharpChat/EventStorage/MariaDBEventStorage_Migrations.cs +++ b/SharpChat/EventStorage/MariaDBEventStorage_Migrations.cs @@ -30,6 +30,15 @@ namespace SharpChat.EventStorage { DoMigration("create_events_table", CreateEventsTable); DoMigration("allow_null_target", AllowNullTarget); + DoMigration("update_event_type_names", UpdateEventTypeNames); + } + + private void UpdateEventTypeNames() { + RunCommand(@"UPDATE sqc_events SET event_type = ""msg:add"" WHERE event_type = ""SharpChat.Events.ChatMessage"""); + RunCommand(@"UPDATE sqc_events SET event_type = ""user:connect"" WHERE event_type = ""SharpChat.Events.UserConnectEvent"""); + RunCommand(@"UPDATE sqc_events SET event_type = ""user:disconnect"" WHERE event_type = ""SharpChat.Events.UserDisconnectEvent"""); + RunCommand(@"UPDATE sqc_events SET event_type = ""chan:join"" WHERE event_type = ""SharpChat.Events.UserChannelJoinEvent"""); + RunCommand(@"UPDATE sqc_events SET event_type = ""chan:leave"" WHERE event_type = ""SharpChat.Events.UserChannelLeaveEvent"""); } private void AllowNullTarget() { diff --git a/SharpChat/Packet/ContextMessagePacket.cs b/SharpChat/Packet/ContextMessagePacket.cs index 0dde06e..52e7873 100644 --- a/SharpChat/Packet/ContextMessagePacket.cs +++ b/SharpChat/Packet/ContextMessagePacket.cs @@ -26,7 +26,6 @@ namespace SharpChat.Packet { switch(Event.Type) { case "msg:add": - case "SharpChat.Events.ChatMessage": if(isBroadcast) { sb.Append(V1_CHATBOT); } else { @@ -58,22 +57,18 @@ namespace SharpChat.Packet { break; case "user:connect": - case "SharpChat.Events.UserConnectEvent": sb.AppendFormat("{0}\t0\fjoin\f{1}", V1_CHATBOT, Event.Sender?.LegacyName); break; case "chan:join": - case "SharpChat.Events.UserChannelJoinEvent": sb.AppendFormat("{0}\t0\fjchan\f{1}", V1_CHATBOT, Event.Sender?.LegacyName); break; case "chan:leave": - case "SharpChat.Events.UserChannelLeaveEvent": sb.AppendFormat("{0}\t0\flchan\f{1}", V1_CHATBOT, Event.Sender?.LegacyName); break; case "user:disconnect": - case "SharpChat.Events.UserDisconnectEvent": sb.AppendFormat( "{0}\t0\f{1}\f{2}", V1_CHATBOT,