Fix issue #599 - Edit messages in thread are duplicated
This commit is contained in:
parent
9846d9ce79
commit
792b0ca77e
|
@ -231,8 +231,10 @@ public class ComposeWorker extends Worker {
|
||||||
if (statusResponse.isSuccessful()) {
|
if (statusResponse.isSuccessful()) {
|
||||||
Status statusReply = statusResponse.body();
|
Status statusReply = statusResponse.body();
|
||||||
if (statusReply != null) {
|
if (statusReply != null) {
|
||||||
|
if (dataPost.statusEditId == null) {
|
||||||
StatusAdapter.sendAction(context, Helper.ARG_STATUS_POSTED, statusReply, null);
|
StatusAdapter.sendAction(context, Helper.ARG_STATUS_POSTED, statusReply, null);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (firstSendMessage == null && statusReply != null) {
|
if (firstSendMessage == null && statusReply != null) {
|
||||||
firstSendMessage = statusReply;
|
firstSendMessage = statusReply;
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,6 +66,7 @@ public class FragmentMastodonContext extends Fragment {
|
||||||
String delete_statuses_for_user = b.getString(Helper.ARG_STATUS_ACCOUNT_ID_DELETED);
|
String delete_statuses_for_user = b.getString(Helper.ARG_STATUS_ACCOUNT_ID_DELETED);
|
||||||
Status status_to_delete = (Status) b.getSerializable(Helper.ARG_STATUS_DELETED);
|
Status status_to_delete = (Status) b.getSerializable(Helper.ARG_STATUS_DELETED);
|
||||||
Status statusPosted = (Status) b.getSerializable(Helper.ARG_STATUS_POSTED);
|
Status statusPosted = (Status) b.getSerializable(Helper.ARG_STATUS_POSTED);
|
||||||
|
Status status_to_update = (Status) b.getSerializable(Helper.ARG_STATUS_UPDATED);
|
||||||
if (receivedStatus != null && statusAdapter != null) {
|
if (receivedStatus != null && statusAdapter != null) {
|
||||||
int position = getPosition(receivedStatus);
|
int position = getPosition(receivedStatus);
|
||||||
if (position >= 0) {
|
if (position >= 0) {
|
||||||
|
@ -97,6 +98,12 @@ public class FragmentMastodonContext extends Fragment {
|
||||||
statuses.remove(position);
|
statuses.remove(position);
|
||||||
statusAdapter.notifyItemRemoved(position);
|
statusAdapter.notifyItemRemoved(position);
|
||||||
}
|
}
|
||||||
|
} else if (status_to_update != null && statusAdapter != null) {
|
||||||
|
int position = getPosition(status_to_update);
|
||||||
|
if (position >= 0) {
|
||||||
|
statuses.set(position, status_to_update);
|
||||||
|
statusAdapter.notifyItemChanged(position);
|
||||||
|
}
|
||||||
} else if (statusPosted != null && statusAdapter != null) {
|
} else if (statusPosted != null && statusAdapter != null) {
|
||||||
if (requireActivity() instanceof ContextActivity) {
|
if (requireActivity() instanceof ContextActivity) {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
Loading…
Reference in New Issue