package chat

import (
	"git.ali33.ru/fcg-xvii/rest"
	"git.ali33.ru/fcg-xvii/rest/rest_websocket"
	"github.com/fcg-xvii/go-tools/json"
)

type User struct {
	ID       int64  `rest:"default"`
	Name     string `rest:"default"`
	Password string `rest:"ignore"`
	Socket   *rest_websocket.WebSocket
}

func (s *User) SendMessage(sender *User, message string, file rest.IReadCloserLen) {
	var files map[string]rest.IReadCloserLen
	if file != nil {
		files = make(map[string]rest.IReadCloserLen)
	}
	mes := rest_websocket.NewMessage(
		"/users/message",
		json.Map{
			"sender": sender,
			"message": message,
		},
		map[string]
	)
}
