issue #252 fixed. Working on #256

parent f8e584fd
......@@ -250,7 +250,7 @@ public class PCBDBHelper extends SQLiteOpenHelper {
values.put("id_stu", id_stu);
db.beginTransaction();
for (Picto picto : vocabulary) {
Log.i(LOG_TAG,"inserting "+picto.get_id()+":"+picto.get_translation()+":"+picto.get_json_attrs()+"-id_sce: "+PCBcontext.getPcbdb().getCurrentUser().get_active_scene());
Log.d(LOG_TAG,"inserting "+picto.get_id()+":"+picto.get_translation()+":"+picto.get_json_attrs()+"-id_sce: "+PCBcontext.getPcbdb().getCurrentUser().get_active_scene());
values.put("id_picto", picto.get_id());
values.put("id_scene", this.currentUser.get_active_scene());
......
......@@ -60,7 +60,7 @@ public class ActionTalk implements Emitter.Listener {
picto_id = picto_stupicto.getInt(param_picto_id);
picto_cat = attrs_stu_picto != null ? attrs_stu_picto.optInt(param_picto_cat, Picto.NO_CATEGORY) : 0;
}
Log.i(LOG_TAG, "Received message '" + action +
Log.d(LOG_TAG, "Received message '" + action +
"' for picto " + picto_id + " (cat " + picto_cat);
for (iActionListener listener : this.listeners)
listener.action(action.equals(action_add)
......
......@@ -34,6 +34,7 @@ public class VocabularyTalk implements Emitter.Listener {
final String param_picto="picto";
final String param_stu_picto="stu_picto";
final String param_picto_id="id";
final String param_stupicto_scene="scene";
final String param_picto_cat="id_cat";
final String action_update="update";
final String action_update_category="update_category";
......@@ -41,6 +42,7 @@ public class VocabularyTalk implements Emitter.Listener {
final String action_delete="delete";
JSONObject msg = (JSONObject) args[0];
try {
Log.i(LOG_TAG, "raw Received message " +msg.toString());
......@@ -51,7 +53,7 @@ public class VocabularyTalk implements Emitter.Listener {
JSONObject picto_stupicto = stu_picto.optJSONObject(param_picto);
int picto_id = picto_stupicto.getInt(param_picto_id);
int picto_cat = attrs_stu_picto!=null ? attrs_stu_picto.optInt(param_picto_cat, Picto.NO_CATEGORY) : 0;
if(PCBcontext.getPcbdb().getCurrentUser().get_active_scene() == msg.getJSONObject("attributes").getInt("id_scene")) {
if(PCBcontext.getPcbdb().getCurrentUser().get_active_scene() == stu_picto.getInt(param_stupicto_scene)) {
PCBcontext.getNetService().nextSynchro(new Date().getTime() + PCBcontext.getNetService().getSynchroTimingLength() * 2); //nos saltamos una sincronización para evitar que llegue antes que los websockets
for (iVocabularyListener listener : this.listeners)
listener.change(action.equals(action_update) ? iVocabularyListener.action.update
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment