#!/usr/bin/python3

class obby_user:
	id = 0
	name = ''
	colour = '000000'

	def __init__(self,id,name,colour):
		self.id = id
		self.name = name
		self.colour = colour

class obby_message:
	text = ''
	timestamp = 0
	
	def __init__(self,text,timestamp):
		self.text = text
		self.timestamp = timestamp

class obby_system_message(obby_message):
	pass

class obby_user_message(obby_message):
	user = 0
	
	def __init__(self,user,text,timestamp):
		self.user = user
		obby_message.__init__(self,text,timestamp)

class obby_part:
	author = 0
	content = ''

class obby_line:
	parts = []
	def __str__(self):
		s = ''
		for part in self.parts:
			s += part.content

class obby_document:
	id = 0
	owner = 0
	title = ''
	lines = []

class obby_session:
	version = ''
	name = ''
	users = []
	documents = []
	chat = []
	
	def __init__(self,fn=''):
		if fn != '':
			self.load_obby_file(fn)
		
	def load_obby_file(self,fn):
		fd = file(fn)
		
		fd.close()

session1 = obby_session()
session = obby_session('~/public/sobby-session')
