mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-22 13:48:52 +01:00
Merge pull request #713 from RomanHargrave/feature_sms-to-mms
Add text-via-MMS option
This commit is contained in:
@@ -80,6 +80,7 @@ public enum QKPreference {
|
|||||||
// MMS
|
// MMS
|
||||||
GROUP_MESSAGING("pref_key_compose_group", true),
|
GROUP_MESSAGING("pref_key_compose_group", true),
|
||||||
AUTOMATIC_DATA("pref_key_auto_data", true),
|
AUTOMATIC_DATA("pref_key_auto_data", true),
|
||||||
|
TEXT_VIA_MMS("pref_key_texts_as_mms", false),
|
||||||
LONG_AS_MMS("", true),
|
LONG_AS_MMS("", true),
|
||||||
LONG_AS_MMS_AFTER("", true),
|
LONG_AS_MMS_AFTER("", true),
|
||||||
MAX_MMS_SIZE("", true),
|
MAX_MMS_SIZE("", true),
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ import android.telephony.TelephonyManager;
|
|||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
|
|
||||||
import com.android.mms.dom.smil.parser.SmilXmlSerializer;
|
import com.android.mms.dom.smil.parser.SmilXmlSerializer;
|
||||||
import com.android.mms.transaction.HttpUtils;
|
import com.android.mms.transaction.HttpUtils;
|
||||||
@@ -140,7 +141,7 @@ public class Transaction {
|
|||||||
*/
|
*/
|
||||||
public void sendNewMessage(Message message, long threadId) {
|
public void sendNewMessage(Message message, long threadId) {
|
||||||
this.saveMessage = message.getSave();
|
this.saveMessage = message.getSave();
|
||||||
|
boolean mmsShortCircuit = QKPreferences.getBoolean(QKPreference.TEXT_VIA_MMS);
|
||||||
// if message:
|
// if message:
|
||||||
// 1) Has images attached
|
// 1) Has images attached
|
||||||
// or
|
// or
|
||||||
@@ -152,7 +153,7 @@ public class Transaction {
|
|||||||
// 2) group messaging is enabled
|
// 2) group messaging is enabled
|
||||||
//
|
//
|
||||||
// then, send as MMS, else send as Voice or SMS
|
// then, send as MMS, else send as Voice or SMS
|
||||||
if (checkMMS(message)) {
|
if (checkMMS(message) || mmsShortCircuit) {
|
||||||
try { Looper.prepare(); } catch (Exception e) { }
|
try { Looper.prepare(); } catch (Exception e) { }
|
||||||
RateController.init(context);
|
RateController.init(context);
|
||||||
DownloadManager.init(context);
|
DownloadManager.init(context);
|
||||||
|
|||||||
@@ -196,6 +196,8 @@
|
|||||||
<string name="pref_auto_download_summary">Automatically download MMS messages when they become available</string>
|
<string name="pref_auto_download_summary">Automatically download MMS messages when they become available</string>
|
||||||
<string name="pref_auto_data">Automatic data</string>
|
<string name="pref_auto_data">Automatic data</string>
|
||||||
<string name="pref_auto_data_summary">Turn on data automatically when sending or receiving MMS</string>
|
<string name="pref_auto_data_summary">Turn on data automatically when sending or receiving MMS</string>
|
||||||
|
<string name="pref_send_texts_as_mms">Send texts as MMS</string>
|
||||||
|
<string name="pref_send_texts_as_mms_summary">Send text messages via MMS instead of SMS</string>
|
||||||
<string name="pref_split">Split SMS</string>
|
<string name="pref_split">Split SMS</string>
|
||||||
<string name="pref_split_summary">Split long messages into separate messages</string>
|
<string name="pref_split_summary">Split long messages into separate messages</string>
|
||||||
<string name="pref_split_counter">Split counter</string>
|
<string name="pref_split_counter">Split counter</string>
|
||||||
|
|||||||
@@ -26,6 +26,13 @@
|
|||||||
android:summary="@string/pref_auto_data_summary"
|
android:summary="@string/pref_auto_data_summary"
|
||||||
android:title="@string/pref_auto_data"
|
android:title="@string/pref_auto_data"
|
||||||
android:widgetLayout="@layout/view_switch" />
|
android:widgetLayout="@layout/view_switch" />
|
||||||
|
<CheckBoxPreference
|
||||||
|
android:defaultValue="false"
|
||||||
|
android:key="pref_key_texts_as_mms"
|
||||||
|
android:layout="@layout/list_item_preference"
|
||||||
|
android:summary="@string/pref_send_texts_as_mms_summary"
|
||||||
|
android:title="@string/pref_send_texts_as_mms"
|
||||||
|
android:widgetLayout="@layout/view_switch" />
|
||||||
<PreferenceCategory
|
<PreferenceCategory
|
||||||
android:layout="@layout/list_item_preference_category"
|
android:layout="@layout/list_item_preference_category"
|
||||||
android:title="@string/pref_category_sending_mms">
|
android:title="@string/pref_category_sending_mms">
|
||||||
@@ -77,4 +84,4 @@
|
|||||||
android:layout="@layout/list_item_preference"
|
android:layout="@layout/list_item_preference"
|
||||||
android:title="@string/pref_mms_port" />
|
android:title="@string/pref_mms_port" />
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
||||||
|
|||||||
Reference in New Issue
Block a user