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

Card messages not rendering #51

Open
AlpaGit opened this issue Mar 25, 2017 · 13 comments
Open

Card messages not rendering #51

AlpaGit opened this issue Mar 25, 2017 · 13 comments

Comments

@AlpaGit
Copy link

AlpaGit commented Mar 25, 2017

Hi, I got this error when I try to run:
raise SSLError(e, request=request)
requests.exceptions.SSLError: hostname 'login.live.com' doesn't match u'gateway.
login.live.com'

@Terrance
Copy link
Owner

Your version of OpenSSL is probably missing subject alt name support -- see this Requests FAQ.

@AlpaGit
Copy link
Author

AlpaGit commented Mar 28, 2017

Thanks, I fix it.

Can you help me for create a Skype Cards ?

@Terrance
Copy link
Owner

Until there's a proper way to send message objects, you can try shoehorning it into sendRaw():

msg = SkypeCardMsg(title="A card!", body="Some accompanying text.",
                   buttons=[SkypeCardMsg.Button(title="Make a test call",
                                                type="call", value="echo123")])
sk.chats[...].sendRaw(content=msg.html, contenttype="text", messagetype="RichText/Media_Card")

It may require some tinkering with the content/message type fields, looks like some of the clients have stricter requirements than others (Android seems fairly liberal and should render the above).

@AlpaGit
Copy link
Author

AlpaGit commented Mar 28, 2017

Firsty thanks for you fast reply,
But I got a error "TypeError: Object of type 'Tag' is not JSON serializable" when I try to run your code

@Terrance
Copy link
Owner

Err, try str(msg.html) instead?

(Not in a position to test right now, but the html field is actually a bs4 tag, unlike what the docs say...)

@AlpaGit
Copy link
Author

AlpaGit commented Mar 28, 2017

Nice, it works, thanks for your help

@AlpaGit
Copy link
Author

AlpaGit commented Mar 29, 2017

I think it's not possible to make it work on Skype Web or Windows Client, but work correctly on Android
I try everythink without success, too bad.

@Terrance
Copy link
Owner

I've yet to get the Windows client to render any. I have one that renders on Skype for Web, somehow copied straight from the Skype Support Bot's response but I'm unsure how I got it to work... 😞

Card on Skype for Web

(Interestingly, call actions are hidden on Skype for Web, but visible + disabled on Android.)

@AlpaGit
Copy link
Author

AlpaGit commented Mar 30, 2017

It works oddly, i'm still searching how to get it work on Windows client, when I try on Web I got:
"Unknown message type "RichText/Media_Card", and I see that their is some fields that you don't take in consideration like "recipient { id, name }" and "timestamp"

@Terrance
Copy link
Owner

Timestamp is currently unimplemented, but can be done provided we either add a (redundant?) second time field, or be dynamic when reading the html property.

The recipient is an interesting one, no idea what it should be in a group conversation given the only cards I've seen are in one-to-ones with the support bot -- maybe the group's thread ID, 19:[email protected]?

Terrance added a commit that referenced this issue Apr 24, 2017
@Terrance
Copy link
Owner

Latest commit adds the missing fields, does that have any effect on the message showing in other clients?

@AlpaGit
Copy link
Author

AlpaGit commented May 13, 2017

Hi, sorry for the long time, It still doesn't work :/

@Terrance Terrance changed the title hostname 'login.live.com' doesn't match u'gateway. login.live.com' Card messages not rendering May 17, 2017
@Terrance
Copy link
Owner

I think this is ultimately down to some client-side check we're tripping in some of the clients -- they likely all perform their own (different) tests for the message being valid, which may well be restricting the sender.

I've successfully rendered cards in Skype for Android (stable and preview releases) and Skype for Windows (UWP on Windows 10), but not Skype for Desktop (Windows) or Skype for Web1.

1 Apart from when I somehow copied a message from the Skype Support bot, but now I can't seem to reproduce that. 😞

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

No branches or pull requests

2 participants