|
|
@ -233,27 +233,20 @@ sub list_room(){ |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if ($opt->{action} eq 'get-access-token'){ |
|
|
|
if (!$opt->{access_token}){ |
|
|
|
login(); |
|
|
|
login(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if ($opt->{action} eq 'get-access-token'){ |
|
|
|
print $opt->{access_token} . "\n"; |
|
|
|
print $opt->{access_token} . "\n"; |
|
|
|
} |
|
|
|
} |
|
|
|
elsif ($opt->{action} eq 'get-room-list'){ |
|
|
|
elsif ($opt->{action} eq 'get-room-list'){ |
|
|
|
login(); |
|
|
|
|
|
|
|
list_room(); |
|
|
|
list_room(); |
|
|
|
} |
|
|
|
} |
|
|
|
elsif ($opt->{action} eq 'send-msg'){ |
|
|
|
elsif ($opt->{action} eq 'send-msg'){ |
|
|
|
if (defined $opt->{access_token}){ |
|
|
|
|
|
|
|
join_room(); |
|
|
|
|
|
|
|
send_msg(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else{ |
|
|
|
|
|
|
|
login(); |
|
|
|
|
|
|
|
join_room(); |
|
|
|
join_room(); |
|
|
|
send_msg(); |
|
|
|
send_msg(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
elsif ($opt->{action} eq 'send-file'){ |
|
|
|
elsif ($opt->{action} eq 'send-file'){ |
|
|
|
login(); |
|
|
|
|
|
|
|
join_room(); |
|
|
|
join_room(); |
|
|
|
send_file(); |
|
|
|
send_file(); |
|
|
|
} |
|
|
|
} |
|
|
|