Changeset b84feab


Ignore:
Timestamp:
Dec 25, 2009, 6:04:37 PM (10 years ago)
Author:
Alejandro R. Sedeño <asedeno@mit.edu>
Branches:
master, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
43fe02f
Parents:
89b700e
Message:
Interpret 'normal' messages the same as 'chat' messages
File:
1 edited

Legend:

Unmodified
Added
Removed
  • perl/modules/Jabber/lib/BarnOwl/Module/Jabber.pm

    r89b700e rb84feab  
    12291229    $props{xml}        = $j->GetXML();
    12301230
    1231     if ( $jtype eq 'chat' ) {
     1231    if ( $jtype eq 'groupchat' ) {
     1232        my $nick = $props{nick} = $from->GetResource();
     1233        my $room = $props{room} = $from->GetJID('base');
     1234        $completion_jids{$room} = 1;
     1235
     1236        $props{sender} = $nick || $room;
     1237        $props{recipient} = $room;
     1238
     1239        if ( $props{subject} && !$props{body} ) {
     1240            $props{body} =
     1241              '[' . $nick . " has set the topic to: " . $props{subject} . "]";
     1242        }
     1243    }
     1244    elsif ( $jtype eq 'headline' ) {
     1245        ;
     1246    }
     1247    elsif ( $jtype eq 'error' ) {
     1248        $props{body}     = "Error "
     1249          . $props{error_code}
     1250          . " sending to "
     1251          . $props{from} . "\n"
     1252          . $props{error};
     1253    }
     1254    else { # chat, or normal (default)
    12321255        $props{private} = 1;
    12331256
     
    12561279            $completion_jids{ $props{recipient} } = 1;
    12571280        }
    1258     }
    1259     elsif ( $jtype eq 'groupchat' ) {
    1260         my $nick = $props{nick} = $from->GetResource();
    1261         my $room = $props{room} = $from->GetJID('base');
    1262         $completion_jids{$room} = 1;
    1263 
    1264         $props{sender} = $nick || $room;
    1265         $props{recipient} = $room;
    1266 
    1267         if ( $props{subject} && !$props{body} ) {
    1268             $props{body} =
    1269               '[' . $nick . " has set the topic to: " . $props{subject} . "]";
    1270         }
    1271     }
    1272     elsif ( $jtype eq 'headline' ) {
    1273     }
    1274     elsif ( $jtype eq 'error' ) {
    1275         $props{body}     = "Error "
    1276           . $props{error_code}
    1277           . " sending to "
    1278           . $props{from} . "\n"
    1279           . $props{error};
    1280     }
    1281     else { # normal (default)
    1282         $props{private} = 1;
    12831281    }
    12841282
Note: See TracChangeset for help on using the changeset viewer.