mirror of
https://github.com/moparisthebest/Conversations
synced 2024-11-30 20:52:21 -05:00
offline sending of images
This commit is contained in:
parent
76f3894107
commit
d067448808
@ -699,8 +699,8 @@ public class XmppConnectionService extends Service {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
message.setStatus(Message.STATUS_WAITING);
|
||||||
if (message.getType() == Message.TYPE_IMAGE) {
|
if (message.getType() == Message.TYPE_IMAGE) {
|
||||||
message.setStatus(Message.STATUS_WAITING);
|
|
||||||
saveInDb = true;
|
saveInDb = true;
|
||||||
addToConversation = true;
|
addToConversation = true;
|
||||||
} else {
|
} else {
|
||||||
@ -719,8 +719,6 @@ public class XmppConnectionService extends Service {
|
|||||||
} else if (!conv.hasValidOtrSession() && message.getPresence() != null) {
|
} else if (!conv.hasValidOtrSession() && message.getPresence() != null) {
|
||||||
conv.startOtrSession(getApplicationContext(),
|
conv.startOtrSession(getApplicationContext(),
|
||||||
message.getPresence(), false);
|
message.getPresence(), false);
|
||||||
} else if (message.getPresence() == null) {
|
|
||||||
message.setStatus(Message.STATUS_WAITING);
|
|
||||||
}
|
}
|
||||||
saveInDb = true;
|
saveInDb = true;
|
||||||
addToConversation = true;
|
addToConversation = true;
|
||||||
@ -749,8 +747,7 @@ public class XmppConnectionService extends Service {
|
|||||||
private void sendUnsendMessages(Conversation conversation) {
|
private void sendUnsendMessages(Conversation conversation) {
|
||||||
for (int i = 0; i < conversation.getMessages().size(); ++i) {
|
for (int i = 0; i < conversation.getMessages().size(); ++i) {
|
||||||
int status = conversation.getMessages().get(i).getStatus();
|
int status = conversation.getMessages().get(i).getStatus();
|
||||||
if ((status == Message.STATUS_UNSEND)
|
if (status == Message.STATUS_WAITING) {
|
||||||
|| (status == Message.STATUS_WAITING)) {
|
|
||||||
resendMessage(conversation.getMessages().get(i));
|
resendMessage(conversation.getMessages().get(i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -799,8 +796,19 @@ public class XmppConnectionService extends Service {
|
|||||||
markMessage(message, Message.STATUS_SEND);
|
markMessage(message, Message.STATUS_SEND);
|
||||||
}
|
}
|
||||||
} else if (message.getType() == Message.TYPE_IMAGE) {
|
} else if (message.getType() == Message.TYPE_IMAGE) {
|
||||||
// TODO: send images
|
Presences presences = message.getConversation().getContact().getPresences();
|
||||||
|
if ((message.getPresence() != null)
|
||||||
|
&& (presences.has(message.getPresence()))) {
|
||||||
|
markMessage(message, Message.STATUS_OFFERED);
|
||||||
|
mJingleConnectionManager.createNewConnection(message);
|
||||||
|
} else {
|
||||||
|
if (presences.size() == 1) {
|
||||||
|
String presence = presences.asStringArray()[0];
|
||||||
|
message.setPresence(presence);
|
||||||
|
markMessage(message, Message.STATUS_OFFERED);
|
||||||
|
mJingleConnectionManager.createNewConnection(message);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -866,6 +866,7 @@ public class ConversationActivity extends XmppActivity {
|
|||||||
} else {
|
} else {
|
||||||
Presences presences = contact.getPresences();
|
Presences presences = contact.getPresences();
|
||||||
if (presences.size() == 0) {
|
if (presences.size() == 0) {
|
||||||
|
conversation.setNextPresence(null);
|
||||||
listener.onPresenceSelected(true, null);
|
listener.onPresenceSelected(true, null);
|
||||||
} else if (presences.size() == 1) {
|
} else if (presences.size() == 1) {
|
||||||
String presence = (String) presences.asStringArray()[0];
|
String presence = (String) presences.asStringArray()[0];
|
||||||
|
Loading…
Reference in New Issue
Block a user