```coffeescript
window.slackReadyFunction = (func) ->
  TS.groups.message_received_sig.add func
  TS.channels.message_received_sig.add func
  TS.ims.message_received_sig.add func
  TS.channels.switched_sig.add func
  TS.groups.switched_sig.add func
  TS.ims.switched_sig.add func
  func()
```

Fix a few cases that caused us to lose our lovely hacks
user
```coffeescript
# 🙈
slackRebuildMsg = TS.client.msg_pane.rebuildMsg
TS.client.msg_pane.rebuild_sig = new signals.Signal
TS.client.msg_pane.rebuildMsg = ->
  slackRebuildMsg()
  TS.client.msg_pane.rebuild_sig.dispatch()

window.slackReadyFunction = (func) ->
  TS.client.msg_pane.rebuild_sig.add func

  for channel_type in ["groups", "channels", "ims", "mpims"]
    TS[channel_type].message_received_sig.add func
    TS[channel_type].switched_sig.add func
    TS[channel_type].history_fetched_sig.add func

  func()
```
assistant