Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.0.0 getDMByName don't exist anymore #126

Closed
brunosiqueira opened this issue Feb 3, 2016 · 4 comments
Closed

2.0.0 getDMByName don't exist anymore #126

brunosiqueira opened this issue Feb 3, 2016 · 4 comments

Comments

@brunosiqueira
Copy link

Hey, guys

Testing the beta version, I realized the the client does not have the method getDMByName(). I also checked that the dataStore can provide the already loaded DMs by ID.

The thing is, I don't have the DM id, only the user's slack_id. Of course I can get the hash and iterate looking for the user's name, but would be interesting if this was encapsulated in the client.

But the most important thing is: with my experience in the last slack client version, when the DM do not exist yet, when we call it for the first time, it is created at slack and updated in the client (right?). This way now it seems like once loaded it is static and do not update itself.

Can you advise on this?

@ghost
Copy link

ghost commented Feb 6, 2016

Looking at the old implementation now

@ghost
Copy link

ghost commented Feb 6, 2016

Ok, so the old function did this:

  getDMByName: (name) ->
    for k of @dms
      if @dms[k].name == name
        return @dms[k]

So, as far as I can tell, this function didn't create a new DM when you call it. Can you explain a bit more by what you mean by it creating and updating in the client?

ghost pushed a commit that referenced this issue Feb 6, 2016
@ghost
Copy link

ghost commented Feb 6, 2016

The commit above adds getDMByName back in. I'm not certain what you're asking on the other part though, so will wait to hear back before I close this issue.

@brunosiqueira
Copy link
Author

@l12s I guess you are right. This is what the method di. Thanks for recreating it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant