mirror of
https://github.com/tijder/SmsMatrix.git
synced 2024-10-27 18:24:01 +00:00
handle sending long sms (#31)
sendTextMessage only works up to 160 chars. sendMultipartTextMessage works in either cases
This commit is contained in:
parent
762cb97000
commit
81f0f69a82
@ -256,13 +256,12 @@ public class Matrix {
|
|||||||
JsonObject json = event.getContent().getAsJsonObject();
|
JsonObject json = event.getContent().getAsJsonObject();
|
||||||
|
|
||||||
if (event.type.equals("m.room.message")) {
|
if (event.type.equals("m.room.message")) {
|
||||||
|
|
||||||
if (json.get("msgtype").getAsString().equals(MESSAGE_TYPE_TEXT)) {
|
if (json.get("msgtype").getAsString().equals(MESSAGE_TYPE_TEXT)) {
|
||||||
String body = json.get("body").getAsString();
|
ArrayList<String> body = smsManager.divideMessage(json.get("body").getAsString());
|
||||||
smsManager.sendTextMessage(room.getTopic(), null, body, null, null);
|
smsManager.sendMultipartTextMessage(room.getTopic(), null, body, null, null);
|
||||||
} else {
|
} else {
|
||||||
String url = session.getContentManager().getDownloadableUrl(json.get("url").getAsString());
|
ArrayList<String> url = smsManager.divideMessage(session.getContentManager().getDownloadableUrl(json.get("url").getAsString()));
|
||||||
smsManager.sendTextMessage(room.getTopic(), null, url, null, null);
|
smsManager.sendMultipartTextMessage(room.getTopic(), null, url, null, null);
|
||||||
}
|
}
|
||||||
} else if (event.type.equals("m.room.member")) {
|
} else if (event.type.equals("m.room.member")) {
|
||||||
if (json.get("membership").getAsString().equals("leave")) {
|
if (json.get("membership").getAsString().equals("leave")) {
|
||||||
|
Loading…
Reference in New Issue
Block a user