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

stalk user callback data does not work with mobile users #63

Open
whoisak opened this issue May 14, 2012 · 13 comments
Open

stalk user callback data does not work with mobile users #63

whoisak opened this issue May 14, 2012 · 13 comments

Comments

@whoisak
Copy link

whoisak commented May 14, 2012

bot.stalk([userid], function(data){console.log('data.roomId: '+data.roomId);})

When calling this code while the [userid] is a mobile user, data.roomId is undefined. it appears that the data object either doesn't get returned or is different in structure.

anyone else come across this, or at least confirm this is true?

@MikeWills
Copy link
Contributor

Hmm... I havn't seen that. I did just get this working, but I have only tried on a desktop. I'll try this out once.

@nick-thompson
Copy link

Have you checked that the data object is in response to a successful query? If it fails, I think you'll find the data returned is this

{ err: 'userId not found.', success: false }

That said, the stalk feature never works for me. I've tried it in various scenarios where it should certainly work, but my bot can never find my user. Any idea what's going on with that?

@alaingilbert
Copy link
Owner

Hum, the stalk feature seems broken in the latest version (V2.0.0), but still work on (V1.5.4).
The only difference between them is that I refactored the whole code to use coffeescript instead of javascript.
I'll fix this !

@alaingilbert
Copy link
Owner

The feature should be fixed b59dc0c
Let me know if you still have some issue with it (or other feature) :)

@nick-thompson
Copy link

Thanks for getting to that so quickly! I'm still getting this issue though:

{ msgid: 4, rooms: [], success: false }

@alaingilbert
Copy link
Owner

This is weird ! Looks like the "directoryGraph" function doesn't work properly for you.
Can you tell me the version of ttapi (in package.json).
Show me the output of :

bot.getFanOf() (You can hide the ids if you want)

And the output of:

bot.directoryGraph(function(data) {console.log(data); });

Basically, I just wanna know if you are fan of some people, and if the directoryGraph work or not !

@alaingilbert
Copy link
Owner

I removed all the people of my bot fans list, And now, I get the same result as you { msgid: 28, rooms: [], success: false }
So it seems like your bot is fan of nobody !

@nick-thompson
Copy link

Hm... so here's my program exactly:

var Bot     = require('ttapi')
  , config  = require('./config')
  , bot     = new Bot(config.bot.auth, config.bot.id, config.bot.room)
  , stalked = 'xxxxxxxxxxxxxxx';


bot.on('ready', function () {
  bot.becomeFan(stalked, function () {
    console.log(bot.getFanOf());

    bot.stalk(stalked, function (data) {
      console.log(data);
    });
  });
});

and the output:

6
{ msgid: 7, rooms: [], success: false }

Previously I didn't have the call to .becomeFan because I had manually made my bot a fan of my user account by signing in on my bot on turntable. I threw it in here at your suggestion though to see if it would help, still getting this :/.

The out put of the directoryGraph function you suggested is this:

{ msgid: 4, rooms: [], success: false }

@nick-thompson
Copy link

I manually signed on to both of my turntable accounts, and from my bot's account I un-fanned and re-fanned my user account. After that the stalking function seems to work fine.

Not sure what was going on there... :/

@Izzmo
Copy link
Collaborator

Izzmo commented Feb 18, 2013

Do you have the section_aware variable in there? That needs to be passed in I believe for this call as well.

@nick-thompson
Copy link

section_aware in the call to bot.stalk? The documentation leads me to believe it's only relevant in the directoryRooms query, which should happen under the hood on my call to stalk.

@Izzmo
Copy link
Collaborator

Izzmo commented Feb 18, 2013

@nick-thompson correct, but the API probably needs updating. In my last pull request, I fixed the room.list call, but I would assume the directory graph method has the same issue.

@geekytime
Copy link

So is this supposed to work properly in the version 1.5.4 of the API?

I was getting similar responses from directoryGraph and stalk, but I kind of assumed they were related to sections and hidden rooms.

Am I up against a bug in the API that I can look at, or are the TT services just enforcing some security/privacy-based rules?

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

6 participants