The function comms_get_twitter_group_direct_messages() is written, but is not used by the comms module at all. This is a useful feature that will extend the use cases and privacy for savy users, where savy is defined by being able to send DM.

Comments

marlon0’s picture

Assigned: Unassigned » marlon0
marlon0’s picture

Some thoughts on this, for my own notes and in case anyone else has input:

Currently all twitter users are imported into drupal based on being a follower of a group's twitter user, so the drupal user already exists by the time tapatio imports their tweets.
When importing tweets from a group's direct-reply stream, the twitter user very likely doesn't already exist as a drupal user.
Therefore, it seems like for each tweet in the direct-reply stream, we'll need to check if the twitter user exists in drupal, and create them if not.

marlon0’s picture

What if a user if following a group and then tweets at that group? We don't want to import the same message 2 times (once in the DM importing function, once in the followers importing function).

comms_get_twitter_group_direct messages should add each user in the DM list if nonexistent and also update that user's comms_twitterfrommsgmaxid (if it's lower than the current message).

THEN comms_get_twitter_tweets can run, and it will skip past any messages already pulled in via DM.

evoltech’s picture

This is a good question and it depends on which code path is taken.

There are two ways the tapatio module can get tweets from followers, one is by pulling them out of the TwitterAPI getStatus method and the other is via the getTweets method from the TwitterSearchAPI (our extension of the TwitterAPI that allows querying search.twitter.com).

I have been neglecting the first path above in the development branch, and I am not sure where in the resulting data structure direct messages are.

If the second path is used however, the dm won't show up in the results from the search api. We could maybe ignore the twitter message id in the case of a direct message?

What do you think? Does this make sense?

marlon0’s picture

I'm not sure I understand when you say "the dm won't show up in the results from the search api" - are you saying TwitterSearchAPI can't retrieve direct messages?

Maybe the solution is to alter comms_get_twitter_tweets to simply disregard any DMs it gets, because any relevant DMs will be imported by comms_get_twitter_group_direct_messages.

evoltech’s picture

Yes I mean that search.twitter.com will not show direct messages.

I think comms_get_twitter_tweets() should call comms_get_twitter_group_direct_messages().

avpaderno’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

I am closing this issue, since it's for a Drupal version no longer supported.