mirror of
https://github.com/moparisthebest/Yaaic
synced 2024-11-29 12:22:21 -05:00
Disable posting non-commands on the ServerInfo view
This commit is contained in:
parent
66d3b2682b
commit
46f5d1d008
@ -364,10 +364,17 @@ public class ConversationActivity extends Activity implements ServiceConnection,
|
|||||||
|
|
||||||
if (conversation != null) {
|
if (conversation != null) {
|
||||||
if (!text.trim().startsWith("/")) {
|
if (!text.trim().startsWith("/")) {
|
||||||
String nickname = this.binder.getService().getConnection(serverId).getNick();
|
if (conversation.getType() != Conversation.TYPE_SERVER) {
|
||||||
conversation.addMessage(new Message("<" + nickname + "> " + text));
|
String nickname = this.binder.getService().getConnection(serverId).getNick();
|
||||||
|
conversation.addMessage(new Message("<" + nickname + "> " + text));
|
||||||
|
this.binder.getService().getConnection(serverId).sendMessage(conversation.getName(), text);
|
||||||
|
} else {
|
||||||
|
Message message = new Message("You can only chat from within a channel or a query");
|
||||||
|
message.setColor(Message.COLOR_YELLOW);
|
||||||
|
message.setIcon(R.drawable.warning);
|
||||||
|
conversation.addMessage(message);
|
||||||
|
}
|
||||||
onConversationMessage(conversation.getName());
|
onConversationMessage(conversation.getName());
|
||||||
this.binder.getService().getConnection(serverId).sendMessage(conversation.getName(), text);
|
|
||||||
} else {
|
} else {
|
||||||
CommandParser.getInstance().parse(text, server, conversation, binder.getService());
|
CommandParser.getInstance().parse(text, server, conversation, binder.getService());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user