forked from jason/cpolis
		
	Make atom feed compatible with multiple authors
This commit is contained in:
		@@ -51,12 +51,18 @@ func GenerateAtomFeed(c *Config, db *DB) (*string, error) {
 | 
			
		||||
			entry.Links[linkID].Type = "image/webp"
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		user, err := db.GetUser(c, article.AuthorID)
 | 
			
		||||
		authors, err := db.GetArticleAuthors(c, article.ID)
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			return nil, fmt.Errorf("error getting user info for Atom feed: %v", err)
 | 
			
		||||
			return nil, fmt.Errorf("error getting article's authors for Atom feed: %v", err)
 | 
			
		||||
		}
 | 
			
		||||
		for _, author := range authors {
 | 
			
		||||
			user, err := db.GetUser(c, author.ID)
 | 
			
		||||
			if err != nil {
 | 
			
		||||
				return nil, fmt.Errorf("error getting user info for Atom feed: %v", err)
 | 
			
		||||
			}
 | 
			
		||||
			authorID := entry.AddAuthor(atom.NewPerson(user.FirstName + " " + user.LastName))
 | 
			
		||||
			entry.Authors[authorID].URI = c.Domain + "/image/serve/" + user.ProfilePicLink
 | 
			
		||||
		}
 | 
			
		||||
		authorID := entry.AddAuthor(atom.NewPerson(user.FirstName + " " + user.LastName))
 | 
			
		||||
		entry.Authors[authorID].URI = c.Domain + "/image/serve/" + user.ProfilePicLink
 | 
			
		||||
 | 
			
		||||
		tags, err := db.GetArticleTags(article.ID)
 | 
			
		||||
		if err != nil {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user