diff --git a/common/forum.go b/common/forum.go index 1630ffd2..83aa340a 100644 --- a/common/forum.go +++ b/common/forum.go @@ -34,8 +34,6 @@ type Forum struct { LastReplyer *User LastReplyerID int LastTopicTime string // So that we can re-calculate the relative time on the spot in /forums/ - - //LastLock sync.RWMutex // ? - Is this safe to copy? Use a pointer to it? Should we do an fstore.Reload() instead? } // ? - What is this for? @@ -54,28 +52,6 @@ func (forum *Forum) Copy() (fcopy Forum) { return fcopy } -/*func (forum *Forum) GetLast() (topic *Topic, user *User) { - forum.LastLock.RLock() - topic = forum.LastTopic - if topic == nil { - topic = &Topic{ID: 0} - } - - user = forum.LastReplyer - if user == nil { - user = &User{ID: 0} - } - forum.LastLock.RUnlock() - return topic, user -} - -func (forum *Forum) SetLast(topic *Topic, user *User) { - forum.LastLock.Lock() - forum.LastTopic = topic - forum.LastReplyer = user - forum.LastLock.Unlock() -}*/ - // TODO: Write tests for this func (forum *Forum) Update(name string, desc string, active bool, preset string) error { if name == "" { diff --git a/forum_perms_store.go b/common/forum_perms_store.go similarity index 99% rename from forum_perms_store.go rename to common/forum_perms_store.go index da6db07c..81f81372 100644 --- a/forum_perms_store.go +++ b/common/forum_perms_store.go @@ -1,11 +1,11 @@ -package main +package common import ( "database/sql" "encoding/json" "log" - "./query_gen/lib" + "../query_gen/lib" ) var fpstore ForumPermsStore diff --git a/group_store.go b/common/group_store.go similarity index 99% rename from group_store.go rename to common/group_store.go index 98065708..18d2ce16 100644 --- a/group_store.go +++ b/common/group_store.go @@ -1,5 +1,5 @@ /* Under Heavy Construction */ -package main +package common import ( "database/sql" @@ -9,7 +9,7 @@ import ( "sort" "sync" - "./query_gen/lib" + "../query_gen/lib" ) var gstore GroupStore