Skip to content

Commit

Permalink
Improve private messaging formatting for the user
Browse files Browse the repository at this point in the history
  • Loading branch information
thedjpetersen committed Feb 23, 2014
1 parent cb27658 commit c507aa2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/components/messageInput.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ app.components.message_input = function() {
if (output[0] === "/" && output.indexOf("/me") !== 0) {
// Stript the slash but emit the rest as a command
app.io.emit("command", {server: server.get("name"), target: target, command: output.substring(1)});
if (output.indexOf("/msg") === 0 ) {
var new_channel = output.split(" ")[1];
server.addChannel(new_channel);
server.addMessage(new_channel, {from: server.get("nick"), text: output.split(" ").splice(2).join(" ")});
}
} else {
output = output.replace("/me", '\u0001ACTION');
app.io.emit("say", {text: output, server: server.get("name"), target: target});
Expand Down
2 changes: 2 additions & 0 deletions src/styl/layout.styl
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ main, .app

.messageAuthor
width: 100px
overflow: hidden
text-overflow: ellipsis

.messageText
flex: 1
Expand Down

0 comments on commit c507aa2

Please sign in to comment.