2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-15 04:20:56 +00:00

32_yowsup.pm: added nickname attribute (by JoWiemann)

git-svn-id: https://svn.fhem.de/fhem/trunk@8911 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
justme-1968 2015-07-07 08:09:49 +00:00
parent 7c52921fa8
commit a50d922fe7

View File

@ -25,7 +25,7 @@ yowsup_Initialize($)
#$hash->{GetFn} = "yowsup_Get"; #$hash->{GetFn} = "yowsup_Get";
$hash->{AttrFn} = "yowsup_Attr"; $hash->{AttrFn} = "yowsup_Attr";
$hash->{AttrList} = "disable:1 "; $hash->{AttrList} = "disable:1 ";
$hash->{AttrList} .= "acceptFrom cmd home ". $readingFnAttributes; $hash->{AttrList} .= "acceptFrom cmd home nickname ". $readingFnAttributes;
} }
##################################### #####################################
@ -181,6 +181,7 @@ yowsup_Connect($)
InternalTimer(gettimeofday()+20, "yowsup_Connect", $hash, 0); InternalTimer(gettimeofday()+20, "yowsup_Connect", $hash, 0);
} }
} }
sub sub
yowsup_Disconnect($) yowsup_Disconnect($)
{ {
@ -334,6 +335,9 @@ yowsup_Parse($$)
if( $hash->{WAITING_FOR_LOGIN} ) { if( $hash->{WAITING_FOR_LOGIN} ) {
yowsup_Write( $hash, '/L' ); yowsup_Write( $hash, '/L' );
yowsup_Write( $hash, '/presence available' ); yowsup_Write( $hash, '/presence available' );
yowsup_Write( $hash, "/presence name '". AttrVal($name, 'nickname', "") ."'" ) if(defined(AttrVal($name, 'nickname', undef)));
#yowsup_Write( $hash, '/ping' ); #yowsup_Write( $hash, '/ping' );
delete $hash->{WAITING_FOR_LOGIN}; delete $hash->{WAITING_FOR_LOGIN};
@ -555,6 +559,9 @@ yowsup_Attr($$$)
PWD -> set to $PWD<br> PWD -> set to $PWD<br>
anything else -> use as $HOME</li> anything else -> use as $HOME</li>
<li>nickname<br>
nickname that will be send as sender</li>
<li>accept_from<br> <li>accept_from<br>
comma separated list of contacts (numbers) from which messages will be accepted</li> comma separated list of contacts (numbers) from which messages will be accepted</li>