Started working on emoji

This commit is contained in:
tsmethurst
2021-04-13 11:56:12 +02:00
parent 2e7ac10d00
commit 9826f3f6d9
16 changed files with 75 additions and 14 deletions

View File

@ -312,6 +312,23 @@ func (ps *postgresService) DeleteWhere(key string, value interface{}, i interfac
HANDY SHORTCUTS
*/
func (ps *postgresService) CreateInstanceAccount() error {
username := ps.config.Host
instanceAccount := &gtsmodel.Account{
Username: username,
}
inserted, err := ps.conn.Model(instanceAccount).Where("username = ?", username).SelectOrInsert();
if err != nil {
return err
}
if inserted {
ps.log.Infof("created instance account %s with id %s",username, instanceAccount.ID)
} else {
ps.log.Infof("instance account %s already exists with id %s", username, instanceAccount.ID)
}
return nil
}
func (ps *postgresService) GetAccountByUserID(userID string, account *gtsmodel.Account) error {
user := &gtsmodel.User{
ID: userID,