func (u *User) isActive() bool {
	if u.guacUser.active != 0 {
		return true
	}
	return false
}
isActive checks if a user is still active
package lib
import "C"
import (
	"errors"
	"fmt"
	"image"
	"log"
	"net"
	"sync"
	"time"
	"unsafe"
	"changkun.de/x/occamy/config"
	"changkun.de/x/occamy/protocol"
)
const UserMaxStreams = 64
const UserClosedStreamIndex = -1
type User struct {
	guacUser   *C.struct_guac_user
	guacClient *C.struct_guac_client
	once       sync.Once
	ID                string
	owner             bool
	active            bool
	lastReceived      time.Time
	lastFrameDuration time.Duration
	processingLag     time.Duration
	info              connectInformation
	client            *Client
	sock              *Socket
	poolStream        *Pool
	poolObject        *Pool
	inputStreams      [UserMaxStreams]Stream
	outputStreams     [UserMaxStreams]Stream
	prev, next        *User  
	data              interface{}
}
type connectInformation struct {
	Host     string
	Port     string
	Username string
	Password string
	optimalWidth      int
	optimalHeight     int
	optimalResolution int
	videoMimetypes    []string
	imageMimetypes    []string
}
func NewUser(s *Socket, c *Client, owner bool, jwt *config.JWT) (*User, error) {
	id := NewID(prefixUser)
	uid := C.CString(id)
	user := C.guac_user_alloc(uid)
	if user == nil {
		C.free(unsafe.Pointer(uid))
		return nil, errorStatus()
	}
	user.socket = s.guacSocket
	user.client = c.guacClient
	if owner {
		user.owner = C.int(1)
	} else {
		user.owner = C.int(0)
	}
	host, port, err := net.SplitHostPort(jwt.Host)
	if err != nil {
		C.free(unsafe.Pointer(uid))
		return nil, err
	}
	istreams := [UserMaxStreams]Stream{}
	for i := 0; i < UserMaxStreams; i++ {
		istreams[i] = Stream{Index: UserClosedStreamIndex}
	}
	ostreams := [UserMaxStreams]Stream{}
	for i := 0; i < UserMaxStreams; i++ {
		ostreams[i] = Stream{Index: UserClosedStreamIndex}
	}
	return &User{
		guacUser:   user,
		guacClient: c.guacClient,
		ID:                id,
		owner:             owner,
		active:            true,
		lastReceived:      time.Now(),
		lastFrameDuration: 0,
		processingLag:     0,
		poolStream:        NewPool(0),
		inputStreams:      istreams,
		outputStreams:     ostreams,
		info: connectInformation{
			Host:     host,
			Port:     port,
			Username: jwt.Username,
			Password: jwt.Password,
		},
		client: c,
	}, nil
}
func (u *User) Close() {
	u.once.Do(func() {
		C.guac_user_free(u.guacUser)
	})
}