Index: chatroom.install =================================================================== --- chatroom.install (revision 5) +++ chatroom.install (working copy) @@ -20,14 +20,14 @@ 'poll_freq' => array( 'type' => 'int', 'not null' => TRUE, - 'default' => 1000, - 'description' => t('Default polling interval, in milliseconds, of all chats in this chatroom.'), + 'default' => 1, + 'description' => t('Default polling interval, in seconds, of all chats in this chatroom.'), ), 'idle_freq' => array( 'type' => 'int', 'not null' => TRUE, - 'default' => 60000, - 'description' => t('Default idle interval, in milliseconds, of all chats in this chatroom.'), + 'default' => 60, + 'description' => t('Default idle interval, in seconds, of all chats in this chatroom.'), ), 'kicked_out_message' => array( 'type' => 'text', @@ -201,14 +201,14 @@ 'poll_freq' => array( 'type' => 'int', 'not null' => TRUE, - 'default' => 1000, - 'description' => t('Polling interval, in milliseconds, of the chat.'), + 'default' => 1, + 'description' => t('Polling interval, in seconds, of the chat.'), ), 'idle_freq' => array( 'type' => 'int', 'not null' => TRUE, - 'default' => 60000, - 'description' => t('Idle interval, in milliseconds, of the chat.'), + 'default' => 60, + 'description' => t('Idle interval, in seconds, of the chat.'), ), 'kicked_out_message' => array( 'type' => 'text', @@ -623,18 +623,20 @@ db_query("INSERT INTO {chatroom} (nid) SELECT nid FROM {chatroom_old_version}"); $result = db_query("SELECT * FROM {chatroom_old_version}"); while ($old_room = db_fetch_object($result)) { - $node = new StdClass(); + $node = node_load($old_room->nid); // Change from $node = new StdClass(); To support other properties like for OG. + $node->nid = $old_room->nid; $node->type = 'chatroom'; $node->module = 'chatroom'; - $node->poll_freq = $old_room->poll_freq; - $node->idle_freq = $old_room->idle_freq; + $node->poll_freq = $old_room->poll_freq / 1000; + $node->idle_freq = $old_room->idle_freq / 1000; $node->max_users = $old_room->max_users; $node->kicked_out_message = $old_room->kicked_out_message; $node->banned_message = $old_room->banned_message; $node->previous_messages_display_count = $old_room->old_msg_count; $node->profile_picture = ''; $node->imagecache_preset = ''; + node_save($node); } @@ -653,7 +655,7 @@ // Migrate messages. db_query("INSERT INTO {chatroom_msg} (cmid, ccid, uid, msg_type, msg, sid, recipient_uid, modified) - SELECT cmid, ccid, uid, msg_type, msg, sid, recipient, modified + SELECT cmid, ccid, uid, msg_type, msg, session_id, recipient, modified FROM {chatroom_msg_old_version}"); foreach ($chat_old_new_map as $old_chat_id => $new_chat_node) { db_query("UPDATE {chatroom_msg} SET ccid = %d WHERE ccid = %d", $new_chat_node->nid, $old_chat_id); @@ -661,7 +663,7 @@ // Migrate banned list. db_query("INSERT INTO {chatroom_ban_list} (nid, uid, admin_uid, modified) - SELECT nid, uid, admin_uid, modified + SELECT crid, uid, admin_uid, modified FROM {chatroom_ban_list_old_version}"); // We don't support some of the old blocks now.