now that chats are nodes, we should add views integration.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jamesialford’s picture

This would be nice to have.

tormi’s picture

Yes, views integration would be nice, missing fields are (maybe more):

Chat: First message (time)
Chat: Last message (time)
Chat: Messages (count)
Chat: Archived (time)

Also, consider replacing chatroom content type with a predefined view panel node type + views (just thinking out loud, where to put chatroom's variables then..). Chatroom's current implementation doesn't support pagination, sorting and other goodies..

Tormi

superfedya’s picture

Chat: First message (time)
Chat: Last message (time)
Chat: Messages (count)
Chat: Archived (time)

+
Chat: Messages Cound
Chat: Users Count

markwk’s picture

Version: 6.x-2.x-dev » 7.x-2.x-dev
acouch’s picture

Just an FYI if you use the data module (http://drupal.org/project/data) you can adopt the chatroom tables which creates a view. Also provides a way to edit individual chat entries. I needed to run http://drupal.org/node/1133900#comment-5684852 before I was able to adopt individual tables.

mkesper’s picture

Wow, I will have to look at that!

markwk’s picture

That's an interesting workaround. Adding views support wouldn't be so hard. Just need to find someone with the time and the strong enough desire to do it :P

james.williams’s picture

Status: Active » Needs review
FileSize
8.43 KB

Someone asked for Views integration? Well, here you go :-)

I haven't added support for the 'format' field in the chatroom table, or any support for the chatroom_role or chatroom_user tables. Someone else will need to add those too, but perhaps it might be best to add those in separate issues, as I would consider the main useful parts of views integration to be included in this patch.

Having said that, there is currently no way to join from the chatroom tables to the tables for the entity/field that the chatroom is 'hosted' on. (e.g. to the node that the chatroom field is on.) I'm not sure how to do that in a good generic way. While that is most likely to be important, views of chatrooms, their messages, and their users & recipients can still be made with this patch. Again, perhaps that specific views integration issue would be best handled in another separate ticket to avoid blocking this simpler views integration from being committed to the module?

Anonymous’s picture

thanks! in general, assume that i have no idea what i'm doing with field integration for chatroom.

if there are deeper changes that we can make to the chatroom field code to improve this situation, i'm open to making those sorts of changes.