Apply cached profile verified status to tweets
This commit is contained in:
		
							parent
							
								
									72d8f35cd1
								
							
						
					
					
						commit
						59a72831c7
					
				
					 1 changed files with 11 additions and 7 deletions
				
			
		| 
						 | 
				
			
			@ -66,8 +66,12 @@ proc fetchProfile*(after: string; query: Query; skipRail=false;
 | 
			
		|||
  if result.user.protected or result.user.suspended:
 | 
			
		||||
    return
 | 
			
		||||
 | 
			
		||||
  if not skipPinned and query.kind == posts and
 | 
			
		||||
     result.user.pinnedTweet > 0 and after.len == 0:
 | 
			
		||||
  if query.kind == posts:
 | 
			
		||||
    if result.user.verified:
 | 
			
		||||
      for chain in result.tweets.content:
 | 
			
		||||
        if chain[0].user.id == result.user.id:
 | 
			
		||||
          chain[0].user.verified = true
 | 
			
		||||
    if not skipPinned and result.user.pinnedTweet > 0 and after.len == 0:
 | 
			
		||||
      let tweet = await getCachedTweet(result.user.pinnedTweet)
 | 
			
		||||
      if not tweet.isNil:
 | 
			
		||||
        tweet.pinned = true
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue