From 6e2cb00008cbf09e556b00f87603797fcaa47e09 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Mon, 16 Apr 2018 05:37:14 -0700 Subject: Depenancy upgrades and movign to dep. (#8630) --- .../mattermost/rsc/google/googleserver/chat.go | 80 ---------------------- 1 file changed, 80 deletions(-) delete mode 100644 vendor/github.com/mattermost/rsc/google/googleserver/chat.go (limited to 'vendor/github.com/mattermost/rsc/google/googleserver/chat.go') diff --git a/vendor/github.com/mattermost/rsc/google/googleserver/chat.go b/vendor/github.com/mattermost/rsc/google/googleserver/chat.go deleted file mode 100644 index 8b064dc92..000000000 --- a/vendor/github.com/mattermost/rsc/google/googleserver/chat.go +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// TODO: Add ChatHangup. -// TODO: Auto-hangup chats that are gone. - -package main - -import ( - "fmt" - - "github.com/mattermost/rsc/google" - "github.com/mattermost/rsc/xmpp" -) - -type chatClient struct { - email string - id string - xmpp *xmpp.Client -} - -var chatClients = map[string]*chatClient{} - -func (*Server) chatClient(cid *google.ChatID) (*chatClient, error) { - id := cid.ID - cc := chatClients[cid.ID] - if cc == nil { - a := google.Cfg.AccountByEmail(cid.Email) - if a == nil { - return nil, fmt.Errorf("unknown account %s", cid.Email) - } - // New client. - cli, err := xmpp.NewClient("talk.google.com:443", a.Email, a.Password) - if err != nil { - return nil, err - } - cc = &chatClient{email: a.Email, id: id, xmpp: cli} - cc.xmpp.Status(cid.Status, cid.StatusMsg) - chatClients[id] = cc - } - return cc, nil -} - -func (srv *Server) ChatRecv(cid *google.ChatID, msg *xmpp.Chat) error { - cc, err := srv.chatClient(cid) - if err != nil { - return err - } - chat, err := cc.xmpp.Recv() - if err != nil { - return err - } - *msg = chat - return nil -} - -func (srv *Server) ChatStatus(cid *google.ChatID, _ *Empty) error { - cc, err := srv.chatClient(cid) - if err != nil { - return err - } - return cc.xmpp.Status(cid.Status, cid.StatusMsg) -} - -func (srv *Server) ChatSend(arg *google.ChatSend, _ *Empty) error { - cc, err := srv.chatClient(arg.ID) - if err != nil { - return err - } - return cc.xmpp.Send(arg.Msg) -} - -func (srv *Server) ChatRoster(cid *google.ChatID, _ *Empty) error { - cc, err := srv.chatClient(cid) - if err != nil { - return err - } - return cc.xmpp.Roster() -} -- cgit v1.2.3-1-g7c22