Would it be possible if an activity status template is commented to save it as a status comment (Status comment module) too (Like Heartbeats module react feature does for node coments), and maybe configurable?

So if one comments an status activity this comment shows up as a status comment on a profile.

Thanks for this module

Comments

Scott Reynolds’s picture

Title: Translating comments on statuses into status comments » Activity comments on statuses into status comments
Status: Active » Postponed

Not anytime soon, would probably be good to add a hook when an Activity Comment is added so that could be possible with some code.

Postponed into after the first release.

pribeh’s picture

subscribing.

IceCreamYou’s picture

Hi, I'm the maintainer of the Facebook-style Statuses suite...

In a separate module, I think it would be as simple as this:

/**
 * Implementation of hook_form_FORM_ID_alter().
 */
function MYMODULE_form_activity_comments_form_alter(&$form, &$form_state) {
  $form['#submit'][] = 'MYMODULE_activitiy_comments_form_submit';
}

/**
 * Activity comment form submit callback.
 */
function MYMODULE_activitiy_comments_form_submit(&$form, &$form_state) {
  $aid = $form_state['values']['aid'];
  $message = db_fetch_object(db_query("SELECT type, eid FROM {activity} WHERE aid = %d", $aid));
  if ($message->type == 'facebook_status') {
    fbssc_save_comment($message->eid, $form_state['values']['activity_comment']);
  }
}

(Obviously it would be a little simpler if it was made part of either Activity Comments or FBSSC.) I haven't tested this code, but there are some workflow problems with it even assuming it works as intended.

  • It only goes from Activity Comment to FBSSC and not the other way around. Doing it backwards is similar albeit a little tricker because of the reverse lookups (and because Activity doesn't have an equivalent _save_comment() function to my knowledge). Anyone looking to try should take a look at activity_comments_form_submit() on line 197 of activity_comments.module (current dev).
  • This code doesn't cover deleting comments. Syncing comment deletion requires the same minor acrobatics as is required to make the code above work backwards (from FBSSC to Activity Comments).

Anyway, it's a place to start for anyone who actually wants to use both Activity Comments and FBSSC at the same time...