mirror of
				https://codeberg.org/tom79/Fedilab.git
				synced 2025-10-20 11:20:16 +03:00 
			
		
		
		
	Fix issue #788 - Forwarded are added back when deleted
This commit is contained in:
		
							parent
							
								
									eb861cdaa0
								
							
						
					
					
						commit
						2b2a3dbc99
					
				
					 2 changed files with 6 additions and 2 deletions
				
			
		| 
						 | 
					@ -116,6 +116,8 @@ public class Status implements Serializable, Cloneable {
 | 
				
			||||||
    public transient boolean isFetchMore = false;
 | 
					    public transient boolean isFetchMore = false;
 | 
				
			||||||
    public transient PositionFetchMore positionFetchMore = PositionFetchMore.BOTTOM;
 | 
					    public transient PositionFetchMore positionFetchMore = PositionFetchMore.BOTTOM;
 | 
				
			||||||
    public boolean isChecked = false;
 | 
					    public boolean isChecked = false;
 | 
				
			||||||
 | 
					    //When forwarding tags
 | 
				
			||||||
 | 
					    public boolean tagAdded = false;
 | 
				
			||||||
    public String translationContent;
 | 
					    public String translationContent;
 | 
				
			||||||
    public boolean translationShown;
 | 
					    public boolean translationShown;
 | 
				
			||||||
    public boolean mathsShown = false;
 | 
					    public boolean mathsShown = false;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1612,7 +1612,8 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
 | 
				
			||||||
                statusDraft.setCursorToEnd = false;
 | 
					                statusDraft.setCursorToEnd = false;
 | 
				
			||||||
                holder.binding.content.setSelection(holder.binding.content.getText().length());
 | 
					                holder.binding.content.setSelection(holder.binding.content.getText().length());
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            if (forwardTag && position > 0 && statusDraft.text != null && !statusDraft.text.contains("#")) {
 | 
					            if (forwardTag && position > 0 && statusDraft.text != null && !statusDraft.text.contains("#") && !statusList.get(position).tagAdded) {
 | 
				
			||||||
 | 
					                statusList.get(position).tagAdded = true;
 | 
				
			||||||
                Status status = statusList.get(position - 1).reblog == null ? statusList.get(position - 1) : statusList.get(position - 1).reblog;
 | 
					                Status status = statusList.get(position - 1).reblog == null ? statusList.get(position - 1) : statusList.get(position - 1).reblog;
 | 
				
			||||||
                if (status.tags != null && status.tags.size() > 0) {
 | 
					                if (status.tags != null && status.tags.size() > 0) {
 | 
				
			||||||
                    statusDraft.text += "\n\n";
 | 
					                    statusDraft.text += "\n\n";
 | 
				
			||||||
| 
						 | 
					@ -1626,8 +1627,9 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
 | 
				
			||||||
                    statusDraft.setCursorToEnd = false;
 | 
					                    statusDraft.setCursorToEnd = false;
 | 
				
			||||||
                    holder.binding.content.setSelection(statusDraft.text.length() - lenght - 3);
 | 
					                    holder.binding.content.setSelection(statusDraft.text.length() - lenght - 3);
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            } else if (forwardTag && position > 0 && statusDraft.text != null && statusDraft.text.contains("#")) {
 | 
					            } else if (forwardTag && position > 0 && statusDraft.text != null && statusDraft.text.contains("#") && !statusList.get(position).tagAdded) {
 | 
				
			||||||
                Status status = statusList.get(position - 1).reblog == null ? statusList.get(position - 1) : statusList.get(position - 1).reblog;
 | 
					                Status status = statusList.get(position - 1).reblog == null ? statusList.get(position - 1) : statusList.get(position - 1).reblog;
 | 
				
			||||||
 | 
					                statusList.get(position).tagAdded = true;
 | 
				
			||||||
                int lenght = 0;
 | 
					                int lenght = 0;
 | 
				
			||||||
                for (Tag tag : status.tags) {
 | 
					                for (Tag tag : status.tags) {
 | 
				
			||||||
                    lenght += ("#" + tag.name + " ").length();
 | 
					                    lenght += ("#" + tag.name + " ").length();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue