| Server IP : 157.230.181.24 / Your IP : 216.73.216.56 Web Server : Apache/2.4.58 (Ubuntu) System : Linux conductive 6.8.0-117-generic #117-Ubuntu SMP PREEMPT_DYNAMIC Tue May 5 19:26:24 UTC 2026 x86_64 User : ( 1000) PHP Version : 8.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/vhosts/ceagon/open-oscar-server/state/ |
Upload File : |
package state
import (
"testing"
"github.com/mk6i/open-oscar-server/wire"
"github.com/stretchr/testify/assert"
)
func TestChatRoom_TLVList(t *testing.T) {
room := NewChatRoom("chat-room-name", NewIdentScreenName(""), PublicExchange)
have := room.TLVList()
want := []wire.TLV{
wire.NewTLVBE(wire.ChatRoomTLVFlags, uint16(15)),
wire.NewTLVBE(wire.ChatRoomTLVCreateTime, uint32(room.createTime.Unix())),
wire.NewTLVBE(wire.ChatRoomTLVMaxMsgLen, uint16(1024)),
wire.NewTLVBE(wire.ChatRoomTLVMaxOccupancy, uint16(100)),
wire.NewTLVBE(wire.ChatRoomTLVNavCreatePerms, uint8(2)),
wire.NewTLVBE(wire.ChatRoomTLVFullyQualifiedName, room.name),
wire.NewTLVBE(wire.ChatRoomTLVRoomName, room.name),
wire.NewTLVBE(wire.ChatRoomTLVMaxMsgVisLen, uint16(1024)),
}
assert.Equal(t, want, have)
}