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>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:mimeType="*/*"
android:scheme="content"
/>
</intent-filter>
<!-- <intent-filter> -->
<!-- <action android:name="android.intent.action.VIEW" /> -->
<!-- <category android:name="android.intent.category.DEFAULT" /> -->
<!-- <category android:name="android.intent.category.BROWSABLE" /> -->
<!-- <data android:mimeType="*/*" -->
<!-- android:scheme="content" -->
<!-- /> -->
<!-- </intent-filter> -->
</activity>
<!-- downloading dicts -->

View file

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

View file

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