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

Use actual hostname instead of abbreviated host/site parameter #45

Closed
banksJeremy opened this issue May 3, 2014 · 2 comments
Closed
Assignees

Comments

@banksJeremy
Copy link
Collaborator

Instead of use abbreviated host/site identifiers, we could use the actual host/domain names of the site. SEChatWrapper(host='stackoverflow.com')

This would allow some of our logic to just use the host value directly, instead of needing to translate from the abbreviated values.

For backwards-compatibility, we can accept the abbreviated names for now, but trigger a DeprecationWarning.

(If completed, I won't merge this directly into master; I'll leave it for @Manishearth to review.)

@banksJeremy banksJeremy self-assigned this May 3, 2014
banksJeremy pushed a commit to jeremyBanks/stack.chat that referenced this issue May 3, 2014
Configures Makefile and .travis.yml to show all warnings.

Cleans up redundant login methods in browser, now using a single method
with a host parameter.

But this isn't actually working yet.

ref Manishearth#45

```
platform darwin -- Python 2.7.5 -- py-1.4.20 -- pytest-2.5.2
plugins: capturelog
collected 6 items

test/test_browser.py F.
test/test_live_messages.py F
test/test_live_openid_login.py ..
test/test_wrapper.py .
```
@Manishearth
Copy link
Owner

The reason for the multiple different login methods was that MSE/SO don't require a separate ping to SE.com/chat-login, logging into the site directly logs you in to chat. But if you can make this work sanely, that would be good :)

banksJeremy pushed a commit to jeremyBanks/stack.chat that referenced this issue May 3, 2014
@banksJeremy
Copy link
Collaborator Author

There's still a special-case for stackexchange.com's login, but the rest of the login conditional chain is now:

        self.br.loginSite(self.host)

        if self.host == 'stackexchange.com':
            self.br.loginChatSE()

loginSEOpenID still sets fkey, because it's available in the post-login page, but for others hosts we don't immediately call .update_chat_key() any more. The request will be made implicitly the first time .chat_fkey() is called, which could be immediately if the bot starts watching a room.

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

2 participants