Facebook-style chat via integration with Appbar
igorik - October 20, 2009 - 20:35
| Project: | Chat Room |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | justinrandell |
| Status: | active |
| Issue tags: | Appbar |
Jump to:
Description
Hi
It would be great to have facebook like chat on bottom panel, in this case the best solution will be probably to integrate it with AppBar module http://drupal.org/project/appbar
for working facebook like chat in drupal (with own bottom panel) and maybe some inspiration you can try Bowob module: http://drupal.org/project/bowob
thanks
Igor

#1
Hi, I'm the Appbar maintainer. Appbar's API makes integration relatively straightforward. I don't have time to actually write a patch any time soon but I will be happy to help if this gets taken up and there are any questions.
#2
igorik, thanks for the suggestion. do you have the time/skills to work on this?
IceCreamYou, thanks. how does Appbar handle page reloads?
#3
Hi Justin,
Unfortunately I have no skills for something like this. I am trying to help community with my comments, ideas, bugreports and future requests and testing for various modules.
Have a nice day
Igor
#4
Justin - I'm not sure what you mean. I've tried to keep the module optimized and efficient, if that's what you're asking.
#5
here's a unpolished patch, just me playing with the API. looks very promising to me, i'd like to explore more.
@IceCreamYou - first issue i hit with the API i'd like to discuss - seems i can't add ids to appbar regions at runtime? the use case here is to have a user choose arbitrary chats that they want to keep open in the appbar, something like this:
<?phpfunction chatroom_appbar_regions_alter(&$regions) {
foreach (chatroom_chat_get_appbar_chats($user) as $node) {
$regions['chatroom-chat-appbar-' . $node->nid] = theme('chatroom_chat_appbar_interface', $node);
}
}
?>
it doesn't look like this is supported, as this code in
theme_appbar_bar():<?php$collected = module_invoke_all('appbar_region');
$ardefault = variable_get('appbar_regions', drupal_map_assoc(array_keys($collected)));
drupal_alter('appbar_regions', $collected);
foreach ($collected as $name => $region) {
if ($ardefault[$name] && $region) {
$regions .= '<div id="'. $name .'">'. $region .'</div>';
}
}
?>
throws warnings if the $name key doesn't exist in $ardefault. i could mess with the 'appbar_regions' variable, but that feels like a layering violation. am i missing something?
would you accept a patch that allows for dynamic runtime keys for appbar_regions?
#6
#7
I don't quite understand what you mean by dynamic regions (I mean, I understand the concept, just not how it doesn't match up with the existing code). However, I'm certainly willing to accept a patch, as you're probably right and I'm just overlooking something.
Also, it looks like the patch you refer to in #5 didn't get attached...
#8
right, sorry, probably not a useful patch right now anyway. just trying to formulate a reply has helped me figure out what i was missing.
hook_appbar_region is called per-request, and not cached anywhere, so i just have to make the return dynamic and per user, and we're good.
#9
Okay, well at least now I know not to cache hook_appbar_region() in the future, heh. Of course let me know if anything else comes up that I could help with.
#10
subscribing
#11
Tagging to make this easier to find.