1
0
mirror of https://github.com/nerzhul/ownCloud-SMS-App.git synced 2025-06-27 17:56:09 +00:00
This commit is contained in:
Loic Blot 2015-03-14 18:02:17 +01:00
commit ffd6a2cffc
3 changed files with 26 additions and 19 deletions

View File

@ -56,3 +56,8 @@ https://github.com/nerzhul/ocsms/issues
## Developpers
You can found our continuous integration here: http://jenkins.unix-experience.fr/job/ownCloud%20SMS%20%28Android%29/
### Coding guidelines
- No empty lines at EOF
- No trailing whitespaces

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
* Copyright (c) 2014, Loic Blot <loic.blot@unix-experience.fr>
* Copyright (c) 2014-2015, Loic Blot <loic.blot@unix-experience.fr>
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -28,7 +28,7 @@
<resources>
<!-- Translation version, reference for translators -->
<string name="translation_version">3</string>
<string name="translation_version">5</string>
<!-- Translations must begin there -->
<!-- Preferences -->
@ -103,7 +103,7 @@
<item>https://</item>
<item>http://</item>
</string-array>
<!-- Main activity -->
<string name="ma_button_rate_us">Ohodnoťit!</string>
<string name="ma_button_thanksto">Poděkování</string>
@ -114,7 +114,8 @@
<string name="ma_title_change_settings">Změnit nastavení aplikace</string>
<string name="ma_button_goto_settings">Přejít do Nastavení</string>
<string name="ma_title_welcome">Vítejte</string>
<string name="ma_content_welcome">Vítejte v aplikaci ownCloud SMS. Tato aplikace umožnuje sychronizovat SMS do vašeho účtu na serveru ownCloud. </string>
<string name="ma_content_welcome">Vítejte v aplikaci ownCloud SMS. Tato aplikace umožnuje sychronizovat SMS do vašeho účtu na serveru ownCloud za pomoci aplikace pro SMS.</string>
<string name="ma_thanksto_people">ownCloud vývojáři\n\ přispěvatelé a ti co hlásí chyby</string>
<!-- Notifications -->
<string name="sync_title">Proces synchronizace</string>
@ -126,7 +127,7 @@
<string name="err_sync_craft_http_request">Chyba #2: Chyba při vytváření HTTP požadavku</string>
<string name="err_sync_push_request">Chyba #3: Požadavek Push selhal</string>
<string name="err_sync_push_request_resp">Chyba #4: Přijata neplatná data ze serveru při jejich odesílání</string>
<string name="err_sync_create_json_null_smslist">Chyba #5: NULL Sms List</string>
<string name="err_sync_create_json_null_smslist">Chyba #5: NULL SMS List</string>
<string name="err_sync_create_json_put_smslist">Chyba #6: Chyba při vytváření Push požadavku</string>
<string name="err_sync_create_json_request_encoding">Chyba #7: Nepodporované kódování při vytváření požadavku</string>
<string name="err_sync_auth_failed">Chyba #8: Ověření selhalo</string>
@ -137,10 +138,11 @@
<string name="err_sync_http_request_resp">Chyba #14: Nelze zpracovat odpověď serveru</string>
<string name="err_sync_http_request_parse_resp">Chyba #15: Nelze zpracovat odpověď serveru</string>
<string name="err_sync_no_connection_available">Chyba #16: Není dostupné datové připojení</string>
<string name="err_sync_account_unparsable">Chyba #17: účet poškozený Znovu nakonfigurovat</string>
<string name="title_activity_main">MainActivity</string>
<string name="title_section1">Sekce 1</string>
<string name="title_section2">Sekce 2</string>
<string name="title_section3">Sekce 3</string>
<string name="hello_world">Hello world!</string>
<string name="title_activity_main_activity2">MainActivity2</string>
</resources>

View File

@ -83,10 +83,6 @@ public class SmsFetcher {
if (colName.equals(new String("_id")) ||
colName.equals(new String("type"))) {
entry.put(colName, c.getInt(idx));
// bufferize Id for future use
if (colName.equals(new String("_id"))) {
}
}
// Seen and read must be pseudo boolean
else if (colName.equals(new String("read")) ||
@ -142,30 +138,34 @@ public class SmsFetcher {
JSONObject entry = new JSONObject();
try {
for(int idx=0;idx<c.getColumnCount();idx++) {
Integer mboxId = -1;
for(int idx = 0;idx < c.getColumnCount(); idx++) {
String colName = c.getColumnName(idx);
// Id column is must be an integer
if (colName.equals(new String("_id")) ||
colName.equals(new String("type"))) {
if (colName.equals(new String("_id"))) {
entry.put(colName, c.getInt(idx));
// bufferize Id for future use
if (colName.equals(new String("_id"))) {
}
}
// Seen and read must be pseudo boolean
else if (colName.equals(new String("read")) ||
colName.equals(new String("seen"))) {
entry.put(colName, c.getInt(idx) > 0 ? "true" : "false");
}
else if (colName.equals(new String("type"))) {
mboxId = c.getInt(idx);
entry.put(colName, c.getInt(idx));
}
else {
entry.put(colName, c.getString(idx));
}
}
// Mailbox ID is required by server
entry.put("mbox", mbID.ordinal());
/*
* Mailbox ID is required by server
* mboxId is greater than server mboxId by 1 because types
* aren't indexed in the same mean
*/
entry.put("mbox", (mboxId - 1));
results.put(entry);
} catch (JSONException e) {