disable attachments as part of invitations -- for now.

This commit is contained in:
Eric House 2012-11-30 07:50:10 -08:00
parent 8b5ec28120
commit 74fec9d3d3
3 changed files with 29 additions and 25 deletions

View file

@ -134,14 +134,14 @@
/> />
</intent-filter> </intent-filter>
<intent-filter> <!-- <intent-filter> -->
<action android:name="android.intent.action.VIEW" /> <!-- <action android:name="android.intent.action.VIEW" /> -->
<category android:name="android.intent.category.DEFAULT" /> <!-- <category android:name="android.intent.category.DEFAULT" /> -->
<category android:name="android.intent.category.BROWSABLE" /> <!-- <category android:name="android.intent.category.BROWSABLE" /> -->
<data android:mimeType="*/*" <!-- <data android:mimeType="*/*" -->
android:scheme="content" <!-- android:scheme="content" -->
/> <!-- /> -->
</intent-filter> <!-- </intent-filter> -->
</activity> </activity>
<!-- downloading dicts --> <!-- downloading dicts -->

View file

@ -549,7 +549,8 @@ public class GameUtils {
intent.putExtra( Intent.EXTRA_SUBJECT, subject ); intent.putExtra( Intent.EXTRA_SUBJECT, subject );
intent.putExtra( Intent.EXTRA_TEXT, Html.fromHtml(message) ); intent.putExtra( Intent.EXTRA_TEXT, Html.fromHtml(message) );
File tmpdir = DictUtils.getDownloadDir( context ); File tmpdir = XWApp.ATTACH_SUPPORTED ?
DictUtils.getDownloadDir( context ) : null;
if ( null == tmpdir ) { // no attachment if ( null == tmpdir ) { // no attachment
intent.setType( "message/rfc822"); intent.setType( "message/rfc822");
} else { } else {
@ -924,23 +925,25 @@ public class GameUtils {
int lang, String dict, int nPlayers ) int lang, String dict, int nPlayers )
{ {
File result = null; File result = null;
JSONObject json = new JSONObject(); if ( XWApp.ATTACH_SUPPORTED ) {
try { JSONObject json = new JSONObject();
json.put( MultiService.ROOM, room ); try {
json.put( MultiService.INVITEID, inviteID ); json.put( MultiService.ROOM, room );
json.put( MultiService.LANG, lang ); json.put( MultiService.INVITEID, inviteID );
json.put( MultiService.DICT, dict ); json.put( MultiService.LANG, lang );
json.put( MultiService.NPLAYERST, nPlayers ); json.put( MultiService.DICT, dict );
byte[] data = json.toString().getBytes(); json.put( MultiService.NPLAYERST, nPlayers );
byte[] data = json.toString().getBytes();
File file = new File( dir, File file = new File( dir,
String.format("invite_%s.json", room ) ); String.format("invite_%s.json", room ) );
FileOutputStream fos = new FileOutputStream( file ); FileOutputStream fos = new FileOutputStream( file );
fos.write( data, 0, data.length ); fos.write( data, 0, data.length );
fos.close(); fos.close();
result = file; result = file;
} catch ( Exception ex ) { } catch ( Exception ex ) {
DbgUtils.loge( ex ); DbgUtils.loge( ex );
}
} }
return result; return result;
} }

View file

@ -32,6 +32,7 @@ public class XWApp extends Application {
public static final boolean BTSUPPORTED = false; public static final boolean BTSUPPORTED = false;
public static final boolean SMSSUPPORTED = true; public static final boolean SMSSUPPORTED = true;
public static final boolean GCMSUPPORTED = true; public static final boolean GCMSUPPORTED = true;
public static final boolean ATTACH_SUPPORTED = false;
public static final boolean DEBUG = false; public static final boolean DEBUG = false;
public static final String SMS_PUBLIC_HEADER = "-XW4"; public static final String SMS_PUBLIC_HEADER = "-XW4";