Daniel García
					
					4 years ago
					
				 
				
			 
		 
		
			
				
					
					No known key found for this signature in database
					
						
							GPG Key ID: FC8A7D14C3CD543A
						
					
				
			
		
		
		
	
		
			
				 2 changed files with 
0 additions and 
16 deletions
			 
			
		 
		
			
				- 
					
					
					 
					src/api/core/ciphers.rs
				
 
			
				- 
					
					
					 
					src/db/models/attachment.rs
				
 
			
		
		
			
			
			
			
			
			
				
				
					
						
							
								
									
	
		
			
				
					| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -687,12 +687,6 @@ fn put_cipher_share_selected( | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        }; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    let attachments = Attachment::find_by_ciphers(cipher_ids, &conn); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    if !attachments.is_empty() { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        err!("Ciphers should not have any attachments.") | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    while let Some(cipher) = data.Ciphers.pop() { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        let mut shared_cipher_data = ShareCipherData { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            Cipher: cipher, | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
				 | 
				
					
  | 
				
			
			
		
	
								
							
						
					 
					
				 
			 
		
			
			
			
			
			
			
				
				
					
						
							
								
									
	
		
			
				
					| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -143,16 +143,6 @@ impl Attachment { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        }} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    pub fn find_by_ciphers(cipher_uuids: Vec<String>, conn: &DbConn) -> Vec<Self> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        db_run! { conn: { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            attachments::table | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                .filter(attachments::cipher_uuid.eq_any(cipher_uuids)) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                .load::<AttachmentDb>(conn) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                .expect("Error loading attachments") | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                .from_db() | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        }} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    pub fn size_by_user(user_uuid: &str, conn: &DbConn) -> i64 { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        db_run! { conn: { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            let result: Option<i64> = attachments::table | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
				 | 
				
					
  |