             
         } else {
             self.stickersButton.hidden = false
+//            if(self.audioButton.hidden){
+//                
+//                self.rightButton.tintColor = appStyle.chatSendColor
+//                self.rightButton.setImage(UIImage.tinted("aa_keyboard", color: appStyle.chatAttachColor), forState: UIControlState.Normal)
+//                self.rightButton.setTitle("", forState: UIControlState.Normal)
+//                self.rightButton.enabled = true
+//                
+//            } else {
+//                
+//                self.rightButton.tintColor = appStyle.chatSendColor
+//                self.rightButton.setImage(UIImage.tinted("aa_keyboard", color: appStyle.chatAttachColor), forState: UIControlState.Normal)
+//                self.rightButton.setTitle("", forState: UIControlState.Normal)
+//                self.rightButton.enabled = true
+//                
+//            }
+            
+            self.micOn = true
+            
+        }
+        
+        self.textInputbar.layoutIfNeeded()
+        self.rightButton.layoutIfNeeded()
+        
+    }
+    
+    // MARK: - right button
+    
+    override func didPressRightButton(sender: AnyObject!) {
+        
+        if !self.textView.text.isEmpty {
+            
+            Actor.sendMessageWithMentionsDetect(peer, withText: textView.text)
+            super.didPressRightButton(sender)
+            
+        } else {
+            
             if(self.audioButton.hidden){
-                
-                self.rightButton.tintColor = appStyle.chatSendColor
-                self.rightButton.setImage(UIImage.tinted("aa_micbutton", color: appStyle.chatAttachColor), forState: UIControlState.Normal)
+                //self.textView.resignFirstResponder()
+                
+                self.rightButton.tintColor = appStyle.chatAttachColor
+                self.rightButton.setImage(UIImage.bundled("keyboard_button"), forState: UIControlState.Normal)
                 self.rightButton.setTitle("", forState: UIControlState.Normal)
                 self.rightButton.enabled = true
                 
-            } else {
-                
-                self.rightButton.tintColor = appStyle.chatSendColor
-                self.rightButton.setImage(UIImage.tinted("aa_keyboard", color: appStyle.chatAttachColor), forState: UIControlState.Normal)
-                self.rightButton.setTitle("", forState: UIControlState.Normal)
-                self.rightButton.enabled = true
-                
-            }
-            
-            self.micOn = true
-            
-        }
-        
-        self.textInputbar.layoutIfNeeded()
-        self.rightButton.layoutIfNeeded()
-        
-    }
-    
-    override func didPressRightButton(sender: AnyObject!) {
-        
-        
-//        Actor.sendMessageWithMentionsDetect(peer, withText: textView.text)
-//        super.didPressRightButton(sender)
-        
-        if !self.textView.text.isEmpty {
-            
-            Actor.sendMessageWithMentionsDetect(peer, withText: textView.text)
-            super.didPressRightButton(sender)
-            
-        } else {
-            
-            if(self.audioButton.hidden){
-                //self.textView.resignFirstResponder()
-                
-                self.rightButton.tintColor = appStyle.chatSendColor
-                self.rightButton.setImage(UIImage.tinted("aa_keyboard", color: appStyle.chatAttachColor), forState: UIControlState.Normal)
-                self.rightButton.setTitle("", forState: UIControlState.Normal)
-                self.rightButton.enabled = true
-                
                 self.textInputbar.layoutIfNeeded()
                 self.rightButton.layoutIfNeeded()
                 

        }
        
        showActionSheet(builder.items, cancelButton: "AlertCancel", destructButton: nil, sourceView: self.leftButton, sourceRect: self.leftButton.bounds, tapClosure: builder.tapClosure)
    }
 
    // Completition
    
    override func didChangeAutoCompletionPrefix(prefix: String!, andWord word: String!) {
        if UInt(self.peer.peerType.ordinal()) == ACPeerType.GROUP.rawValue {

        }
    }
    
    // MARK: - Text bar actions
    
    override func textWillUpdate() {
        super.textWillUpdate();

        Actor.onTypingWithPeer(peer);
    }
    
    
    
    override func textDidUpdate(animated: Bool) {
        super.textDidUpdate(animated)
