This C++ code in player.cpp:
if(!plantsleep && (furn_at_pos == f_bed || furn_at_pos == f_makeshift_bed ||
trap_at_pos.loadid == tr_cot || trap_at_pos.loadid == tr_rollmat ||
trap_at_pos.loadid == tr_fur_rollmat || furn_at_pos == f_armchair ||
furn_at_pos == f_sofa || furn_at_pos == f_autodoc_couch ||
furn_at_pos == f_hay || furn_at_pos == f_straw_bed ||
ter_at_pos == t_improvised_shelter || (in_shell) || (websleeping) ||
vp.part_with_feature( "SEAT", true ) ||
vp.part_with_feature( "BED", true ) ) ) {
add_msg_if_player(m_good, _("This is a comfortable place to sleep."));
}
It really needs to get moved to a couple of JSON flags.