Removed dead code.

Moved more files into subpackages 2/?
This commit is contained in:
Azareal 2017-11-10 03:43:38 +00:00
parent 20bb909c54
commit 10e681f15f
3 changed files with 4 additions and 28 deletions

View File

@ -34,8 +34,6 @@ type Forum struct {
LastReplyer *User LastReplyer *User
LastReplyerID int LastReplyerID int
LastTopicTime string // So that we can re-calculate the relative time on the spot in /forums/ 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? // ? - What is this for?
@ -54,28 +52,6 @@ func (forum *Forum) Copy() (fcopy Forum) {
return fcopy 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 // TODO: Write tests for this
func (forum *Forum) Update(name string, desc string, active bool, preset string) error { func (forum *Forum) Update(name string, desc string, active bool, preset string) error {
if name == "" { if name == "" {

View File

@ -1,11 +1,11 @@
package main package common
import ( import (
"database/sql" "database/sql"
"encoding/json" "encoding/json"
"log" "log"
"./query_gen/lib" "../query_gen/lib"
) )
var fpstore ForumPermsStore var fpstore ForumPermsStore

View File

@ -1,5 +1,5 @@
/* Under Heavy Construction */ /* Under Heavy Construction */
package main package common
import ( import (
"database/sql" "database/sql"
@ -9,7 +9,7 @@ import (
"sort" "sort"
"sync" "sync"
"./query_gen/lib" "../query_gen/lib"
) )
var gstore GroupStore var gstore GroupStore