View Single Post
peterleinchen's Avatar
Posts: 4,118 | Thanked: 8,901 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#1006
@xes
I am using that ".bak" as this is the original first downloaded message (always, as it does not get overwritten if there is already a bak file).
It will not get overwritten (never) but only deleted after successful decoding:
Code:
		os.system("if [ ! -f /home/user/.fmms/mms/" + trans_id + "/message.bak ]; then cp /home/user/.fmms/mms/" + trans_id + "/message /home/user/.fmms/mms/" + trans_id + "/message.bak; fi")
		message = self.decode_binary_mms(path)
		os.system("if [ -f /home/user/.fmms/mms/" + trans_id + "/message.bak ]; then diff /home/user/.fmms/mms/" + trans_id + "/message /home/user/.fmms/mms/" + trans_id + "/message.bak; if [ \"$?\" == \"0\" ]; then rm /home/user/.fmms/mms/" + trans_id + "/message.bak; fi; fi")
So when you say it is 'overwritten', only thing I can think of is:
the message is download
a confirmation is sent (so server deletes)
decoding takes place perfectly (as you see the contents in subdir)
but then in store_mms_message something goes wild

That would explain your contents, the deleted bak file, the new bak file with the "empty-already-deleted message from server".

I have atm no idea what goes wrong but check status of database file /home/user/.fmms/mms.db
It is sqlite format. Possibly read-only or some other rights problem? (e.g. started fmms from terminal as root?)

I hope you can debug that and provide patch or solution.
Did you check the /tmp/fmms.log for "Something went wrong when inserting"?

Possible approach for you to start:
change controller.py
from
Code:
		os.system("if [ ! -f /home/user/.fmms/mms/" + trans_id + "/message.bak ]; then cp /home/user/.fmms/mms/" + trans_id + "/message /home/user/.fmms/mms/" + trans_id + "/message.bak; fi")
		message = self.decode_binary_mms(path)
		os.system("if [ -f /home/user/.fmms/mms/" + trans_id + "/message.bak ]; then diff /home/user/.fmms/mms/" + trans_id + "/message /home/user/.fmms/mms/" + trans_id + "/message.bak; if [ \"$?\" == \"0\" ]; then rm /home/user/.fmms/mms/" + trans_id + "/message.bak; fi; fi")
		log.info("storing mms...%s", trans_id)
		mmsid = self.store_mms_message(pushid, message)
to
Code:
		os.system("if [ ! -f /home/user/.fmms/mms/" + trans_id + "/message.bak ]; then cp /home/user/.fmms/mms/" + trans_id + "/message /home/user/.fmms/mms/" + trans_id + "/message.bak; fi")
		message = self.decode_binary_mms(path)
		log.info("storing mms...%s", trans_id)
		mmsid = self.store_mms_message(pushid, message)
		os.system("if [ -f /home/user/.fmms/mms/" + trans_id + "/message.bak ]; then diff /home/user/.fmms/mms/" + trans_id + "/message /home/user/.fmms/mms/" + trans_id + "/message.bak; if [ \"$?\" == \"0\" ]; then rm /home/user/.fmms/mms/" + trans_id + "/message.bak; fi; fi")
That way the first downloaded original raw message should not get deleted.

--edit
regarding the MMS version: it does not matter which version number they put in there, as long as they are not using header fields other than v1.0 ( as Ilew pointed out). So that is not the culprit.
__________________
SIM-Switcher, automated SIM switching with a Double (Dual) SIM adapter
--
Thank you all for voting me into the Community Council 2014-2016!

Please consider your membership / supporting Maemo e.V. and help to spread this by following/copying this link to your TMO signature:
[MC eV] Maemo Community eV membership application, http://talk.maemo.org/showthread.php?t=94257

editsignature, http://talk.maemo.org/profile.php?do=editsignature
 

The Following 2 Users Say Thank You to peterleinchen For This Useful Post: