       if status is "bind"
         channel.addOnlineUser presence
       else if status is "unbind"
-        channel.removeOfflineUser presence    
+        channel.removeOfflineUser presence
+
+    channel.view.registerListener
+      KDEventTypes  : "AutoCompleteNeedsMemberData"
+      listener      : @
+      callback      : (pubInst,event)=>
+        {callback,inputValue,blacklist} = event
+        @fetchAutoCompleteForMentionField inputValue,blacklist,callback 
 
     # When the channel's view receives chat input, parse the body
     # and broadcast it to corresponding channels.
     channel.view.on "ChatMessageSent", (messageBody) =>
-      @parseMessage messageBody, channel
-      @broadcastOwnMessage messageBody, channel 
+      @parseMessage messageBody, name
+      @broadcastOwnMessage messageBody, name 
       # Also broadcast to public channel
       if name isnt PUBLIC
-        @broadcastOwnMessage messageBody, @channels[PUBLIC], channel
+        @broadcastOwnMessage messageBody, PUBLIC, name
 
     # Delegates to the channel to handle received message
     @broadcaster.on channelName, (msg) ->

are in, handling the communication between the ChatView and each
Channel instance.
###
TOPICREGEX = /#([\w-]+)/g
MENTIONREGEX = /@([\w-]+)/g

class Chat12345 extends AppController

      body: messageBody
      meta: {createdAt: new Date().toISOString()}

    chatItem.channel = fromChannel if fromChannel?.match(TOPICREGEX)

    channelMQName = "client-#{toChannel}"
    @broadcaster.emit channelMQName, JSON.stringify(chatItem)
    return unless @channels[toChannel]
    #chatItem.author = "me"
    @channels[toChannel].messageReceived chatItem

  fetchAutoCompleteForMentionField:(inputValue,blacklist,callback)->
    bongo.api.JAccount.byRelevance inputValue,{blacklist},(err,accounts)->
      callback accounts

class Channel extends KDEventEmitter
  constructor: (options = {}, data) ->
