Fix import of pyserial, encode strings
Try this if you have problems with the pyserial import (AttributeError: 'module' object has no attribute 'Serial') or string encoding
hello, i also said my opinion in the chat before, but i would like to also put it in here, to feed the conversation, or just to give my point of view.
like rion did, i could also give some examples, to show why the currently implementation for uploads is wrong in my opinion. I could say for example that a user create 2 different accounts so to upload through 2 different upload services, so to use these uploads later to produce/feed a blog or something else in public. More important, while not obvious at 1st, if psi reuse already upload links based on the file and not based on the account, that can be used to track or even identify the user, and maybe this is something the user don't want, for some reason.
While these are some examples, i'm going to ignore both of them, and i'll say that, if the same file have already uploaded, the selection of a link from the cache, only by the same name and same content is absolutely wrong.
A possible already created link, must be chosen based by the account, then by name and content. I'm relatively new to xmpp, but i will dare to call a different approach than this as a bug.
In my opinion, as psi is a multi-account client ( and a great one ), the client must respect the account settings, and one of these settings is the upload service, provided by the server, like bookmarks, privacy lists, pubsub, and so on. This is not something that the client must decide if gonna follow. It must!
Maybe an option ignore upload service would make sense for some, but an option obey my settings on server is make no sense
So, while see the cache into ~/.cache/psi/bob/, an upload consist of 2 things, a copy of the upload named by the content hash as the xep need, and an entry inside cache.xml.
An idea/way maybe is the entries inside xml, to grouped by the account name, and then the upload to keep it's content hash name but also prefixed by a hash or a plain of an account identifier. for example: acc_hash-ctx_hash.jpg.
If space is a matter, and must be, we could also make something dirty, like copy the file under the name ctx_hash.jpg, then create a softlink like acc1_hash_ctx_hash.jpg, acc2_hash_ctx_hash.jpg, and so on if user uploads the same file through different accounts, so to avoid duplicate copies, but not sure if this make sense or is valid based on the code already used.
thank you. _