forked from distok/cutthecord
		
	
							parent
							
								
									3a3a87e5b0
								
							
						
					
					
						commit
						be8022f711
					
				
					 2 changed files with 103 additions and 0 deletions
				
			
		
							
								
								
									
										91
									
								
								patches/embedlinks/1246.patch
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										91
									
								
								patches/embedlinks/1246.patch
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,91 @@
 | 
				
			||||||
 | 
					diff -crB from/smali/com/discord/utilities/textprocessing/MessagePreprocessor.smali to/smali/com/discord/utilities/textprocessing/MessagePreprocessor.smali
 | 
				
			||||||
 | 
					*** from/smali/com/discord/utilities/textprocessing/MessagePreprocessor.smali	2020-08-22 13:24:24.120000000 +0300
 | 
				
			||||||
 | 
					--- to/smali/com/discord/utilities/textprocessing/MessagePreprocessor.smali	2020-08-22 14:25:40.980000000 +0300
 | 
				
			||||||
 | 
					***************
 | 
				
			||||||
 | 
					*** 476,552 ****
 | 
				
			||||||
 | 
					  .end method
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
 | 
					  .method private final stripSimpleEmbedLink(Ljava/util/Collection;)V
 | 
				
			||||||
 | 
					!     .locals 3
 | 
				
			||||||
 | 
					!     .annotation system Ldalvik/annotation/Signature;
 | 
				
			||||||
 | 
					!         value = {
 | 
				
			||||||
 | 
					!             "(",
 | 
				
			||||||
 | 
					!             "Ljava/util/Collection<",
 | 
				
			||||||
 | 
					!             "Lcom/discord/simpleast/core/node/Node<",
 | 
				
			||||||
 | 
					!             "Lcom/discord/utilities/textprocessing/MessageRenderContext;",
 | 
				
			||||||
 | 
					!             ">;>;)V"
 | 
				
			||||||
 | 
					!         }
 | 
				
			||||||
 | 
					!     .end annotation
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
 | 
					-     .line 1
 | 
				
			||||||
 | 
					-     invoke-interface {p1}, Ljava/util/Collection;->size()I
 | 
				
			||||||
 | 
					- 
 | 
				
			||||||
 | 
					-     move-result v0
 | 
				
			||||||
 | 
					- 
 | 
				
			||||||
 | 
					-     const/4 v1, 0x1
 | 
				
			||||||
 | 
					- 
 | 
				
			||||||
 | 
					-     if-ne v0, v1, :cond_2
 | 
				
			||||||
 | 
					- 
 | 
				
			||||||
 | 
					-     iget-object v0, p0, Lcom/discord/utilities/textprocessing/MessagePreprocessor;->embeds:Ljava/util/List;
 | 
				
			||||||
 | 
					- 
 | 
				
			||||||
 | 
					-     if-eqz v0, :cond_2
 | 
				
			||||||
 | 
					- 
 | 
				
			||||||
 | 
					-     invoke-interface {v0}, Ljava/util/List;->size()I
 | 
				
			||||||
 | 
					- 
 | 
				
			||||||
 | 
					-     move-result v0
 | 
				
			||||||
 | 
					- 
 | 
				
			||||||
 | 
					-     if-eq v0, v1, :cond_0
 | 
				
			||||||
 | 
					- 
 | 
				
			||||||
 | 
					-     goto :goto_0
 | 
				
			||||||
 | 
					- 
 | 
				
			||||||
 | 
					-     :cond_0
 | 
				
			||||||
 | 
					-     const/4 v0, 0x0
 | 
				
			||||||
 | 
					- 
 | 
				
			||||||
 | 
					-     .line 2
 | 
				
			||||||
 | 
					-     invoke-static {p1, v0}, Lj0/i/l;->elementAt(Ljava/lang/Iterable;I)Ljava/lang/Object;
 | 
				
			||||||
 | 
					- 
 | 
				
			||||||
 | 
					-     move-result-object v1
 | 
				
			||||||
 | 
					- 
 | 
				
			||||||
 | 
					-     check-cast v1, Lcom/discord/simpleast/core/node/Node;
 | 
				
			||||||
 | 
					- 
 | 
				
			||||||
 | 
					-     .line 3
 | 
				
			||||||
 | 
					-     iget-object v2, p0, Lcom/discord/utilities/textprocessing/MessagePreprocessor;->embeds:Ljava/util/List;
 | 
				
			||||||
 | 
					- 
 | 
				
			||||||
 | 
					-     invoke-interface {v2, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;
 | 
				
			||||||
 | 
					- 
 | 
				
			||||||
 | 
					-     move-result-object v0
 | 
				
			||||||
 | 
					- 
 | 
				
			||||||
 | 
					-     check-cast v0, Lcom/discord/models/domain/ModelMessageEmbed;
 | 
				
			||||||
 | 
					- 
 | 
				
			||||||
 | 
					-     .line 4
 | 
				
			||||||
 | 
					-     instance-of v1, v1, Lcom/discord/utilities/textprocessing/node/UrlNode;
 | 
				
			||||||
 | 
					- 
 | 
				
			||||||
 | 
					-     if-nez v1, :cond_1
 | 
				
			||||||
 | 
					- 
 | 
				
			||||||
 | 
					-     return-void
 | 
				
			||||||
 | 
					- 
 | 
				
			||||||
 | 
					-     .line 5
 | 
				
			||||||
 | 
					-     :cond_1
 | 
				
			||||||
 | 
					-     invoke-virtual {v0}, Lcom/discord/models/domain/ModelMessageEmbed;->isSimpleEmbed()Z
 | 
				
			||||||
 | 
					- 
 | 
				
			||||||
 | 
					-     move-result v0
 | 
				
			||||||
 | 
					- 
 | 
				
			||||||
 | 
					-     if-eqz v0, :cond_2
 | 
				
			||||||
 | 
					- 
 | 
				
			||||||
 | 
					-     .line 6
 | 
				
			||||||
 | 
					-     invoke-interface {p1}, Ljava/util/Collection;->clear()V
 | 
				
			||||||
 | 
					- 
 | 
				
			||||||
 | 
					-     :cond_2
 | 
				
			||||||
 | 
					-     :goto_0
 | 
				
			||||||
 | 
					      return-void
 | 
				
			||||||
 | 
					  .end method
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
 | 
					--- 476,483 ----
 | 
				
			||||||
 | 
					  .end method
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
 | 
					  .method private final stripSimpleEmbedLink(Ljava/util/Collection;)V
 | 
				
			||||||
 | 
					!     .locals 0
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
 | 
					      return-void
 | 
				
			||||||
 | 
					  .end method
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
							
								
								
									
										12
									
								
								patches/embedlinks/README.md
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								patches/embedlinks/README.md
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,12 @@
 | 
				
			||||||
 | 
					## DisTok CutTheCord: Embed Links
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Bring back embed links when it's the only thing contained in the message.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					to
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#### Available and tested on:
 | 
				
			||||||
 | 
					- 36.5
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue