@@ -14,7 +14,7 @@ import firebase from "../firebase";
1414import useFirebaseQuery from "../hooks/useFirebaseQuery" ;
1515import useStats from "../hooks/useStats" ;
1616import useStorage from "../hooks/useStorage" ;
17- import { censorText } from "../util" ;
17+ import { censorText , unicodeTrim } from "../util" ;
1818import autoscroll from "../utils/autoscroll" ;
1919import emoji from "../utils/emoji" ;
2020import ChatCards from "./ChatCards" ;
@@ -80,9 +80,6 @@ const useStyles = makeStyles((theme) => ({
8080 margin : "0 -4px" ,
8181 padding : "0 4px 0 2px" ,
8282 } ,
83- action : {
84- fontStyle : "italic" ,
85- } ,
8683} ) ) ;
8784
8885const makeMentionRE = ( username ) => {
@@ -134,11 +131,8 @@ function Chat({
134131
135132 function handleSubmit ( event ) {
136133 event . preventDefault ( ) ;
137- let text = input . trim ( ) ;
134+ const text = unicodeTrim ( input ) ;
138135 if ( text ) {
139- if ( text . startsWith ( "/slap " ) ) {
140- text = `/me slaps ${ text . slice ( 6 ) } around a bit with a large trout` ;
141- }
142136 firebase
143137 . database ( )
144138 . ref ( databasePath )
@@ -251,29 +245,13 @@ function Chat({
251245 item . time ,
252246 < Typography variant = "body2" >
253247 { formatTime ( item . time ) }
254- { item . message . startsWith ( "/me " ) ? (
255- < span className = { classes . action } >
256- *{ " " }
257- < User
258- id = { item . user }
259- style = { { color : "inherit" , fontWeight : "inherit" } }
260- showIcon = { false }
261- component = { InternalLink }
262- to = { `/profile/${ item . user } ` }
263- />
264- { item . message . slice ( 3 ) }
265- </ span >
266- ) : (
267- < >
268- < User
269- id = { item . user }
270- component = { InternalLink }
271- to = { `/profile/${ item . user } ` }
272- underline = "none"
273- />
274- : { item . message }
275- </ >
276- ) }
248+ < User
249+ id = { item . user }
250+ component = { InternalLink }
251+ to = { `/profile/${ item . user } ` }
252+ underline = "none"
253+ />
254+ : { item . message }
277255 </ Typography >
278256 ) }
279257 { user . admin && (
0 commit comments