Giter Site home page Giter Site logo

Comments (14)

okdistribute avatar okdistribute commented on August 14, 2024 1

great @r10s it does seem more elegant to fix this in core. @ralphtheninja what do you think?

from deltachat-desktop.

ralphtheninja avatar ralphtheninja commented on August 14, 2024

I'll have a look.

from deltachat-desktop.

ralphtheninja avatar ralphtheninja commented on August 14, 2024

Just realized that we never implemented dc_is_open(). I skipped it for some reason I forgot. But I think that if we implement that, we should be able to open the context only if it's not open, similarly to configuring when not configured. That's what I'm hoping at least.

@r10 Does this make sense?

from deltachat-desktop.

r10s avatar r10s commented on August 14, 2024

just had a look at the source: in fact, the dc_open() may crash when called for an already opened database. i will fix this by calling dc_is_open() before.

however, in general, in general it is not needed to call dc_close() just because a configuration failed. from the view of the core, it is fine to call dc_configure() several times, eg. this is also done for changing the password or other settings.

from deltachat-desktop.

hpk42 avatar hpk42 commented on August 14, 2024

from deltachat-desktop.

r10s avatar r10s commented on August 14, 2024

jipp, dc_context_unref() implies dc_close().

also had a look at the Android part: also there dc_close() is never called.

from deltachat-desktop.

ralphtheninja avatar ralphtheninja commented on August 14, 2024

great @r10s it does seem more elegant to fix this in core. @ralphtheninja what do you think?

But the issue with multiple accounts still remain.

@r10s What do you recommend we do for multiple accounts? Can you use the same db? In desktop we point out different folders for different accounts.

from deltachat-desktop.

okdistribute avatar okdistribute commented on August 14, 2024

@ralphtheninja I remember talking about multiple accounts in freiburg and it seemed like not on the immediate roadmap -- using a different db seemed like a nice solution. So for us we probably still want to close the old DB if one exists

from deltachat-desktop.

hpk42 avatar hpk42 commented on August 14, 2024

from deltachat-desktop.

r10s avatar r10s commented on August 14, 2024

i would suggest to simply remove dc_close() from the api.
lots of troubles less.

from deltachat-desktop.

ralphtheninja avatar ralphtheninja commented on August 14, 2024

If you have a directory with different DBs and want to show a selector of the different accounts, say db1, db2, db3 in a particular application dir, you can make a for-loop over the dbs, opening each, checking if is_configured() is true, getting the "addr" config, and closing it.

That's a really cool way of enumerating the accounts. We should show a list of already configured accounts and you click one of them to "login". Would be a neat way of logging in without having to type addr.

from deltachat-desktop.

ralphtheninja avatar ralphtheninja commented on August 14, 2024

i would suggest to simply remove dc_close() from the api.
lots of troubles less.

Sounds good to me! It would also make the bindings simpler.

from deltachat-desktop.

okdistribute avatar okdistribute commented on August 14, 2024

@ralphtheninja @hpk42 I still think it's a good idea to be able to reverse-lookup an existing account, in case someone types in an email that is in the list

from deltachat-desktop.

okdistribute avatar okdistribute commented on August 14, 2024

moving this to a new issue.

from deltachat-desktop.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.