       let token = team?.token!
       let id = cwr.button.stringTag
       
-      obsList.append(channelApi.getHistoryByFlavor(token: token!, id:id, flavor: flavor, count: 1))
+      //let ob = channelApi.getHistoryByFlavor(token: token!, id:id, flavor: flavor, count: 1)
+      let url = "https://slack.com/api/im.history?token=\(token ?? "")&channel=\(id)&count=1"
+      Swift.print("Request: \(url)")
+      Alamofire.request(url).responseJSON { response in
+        if let json = response.result.value as? [String: Any] {
+          
+          let messages = json["messages"]
+          if messages != nil {
+            let list = json["messages"] as! NSArray
+            if list.count > 0 {
+              let message = list[0] as? [String: Any]
+              let ts = message?["ts"] as! String
+              let tsd = Double(ts)
+              Swift.print("JSON: \(tsd)")
+            }
+          }
+        }
+      }
+      
     }
     
-    Observable.zip(obsList) { (messages) in
-          NSLog("hey \(messages)")
-      }.subscribeOn(ConcurrentDispatchQueueScheduler(qos: .background))
-      .observeOn(MainScheduler.instance)
-      .subscribe(
-        onError: { error in
-          NSLog("1111 \(error)")
-      }
-      )
-      .addDisposableTo(disposeBag)
+
 
     
     //let alert = notification.object as! NSAlert

import Cocoa
import Moya
import RxSwift

class ButtonWithStringTag: NSButton {
  var stringTag: String = ""

  
  func sortByLastMsgDate(notification: NSNotification) {
    
    //let provider = RxMoyaProvider<ChatService>()
    //let channelApi = ChannelApiImpl(provider: provider)
    //var obsList: [Observable<Messages>] = []
    
    for sv in list.subviews {
      let cwr = sv as! ChannelWithRed
