feature: 70_Jabber Added possibility to change componentname via attr JabberDomain

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@12904 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
BioS 2016-12-29 12:44:32 +00:00
parent a761283000
commit c350a23aa2
2 changed files with 18 additions and 3 deletions

View File

@ -1,5 +1,7 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it.
- feature: 70_Jabber Added possibility to change componentname via
attr JabberDomain
- feature: 93_DbRep: function readingRename added, delEntries is able to
use SQL-Wildcards in attr reading/device
- bugfix: 98_Verkehrsinfo.pm: Fix state update, Hessenschau message

View File

@ -23,9 +23,10 @@
# You should have received a copy of the GNU General Public License
# along with fhem. If not, see <http://www.gnu.org/licenses/>.
#
# Version: 1.6 - 2015-09-17
# Version: 1.7 - 2016-12-29
#
# Changelog:
# v1.7 2016-12-29 Added possibility to change componentname via attr JabberDomain (thx Turbokid)
# v1.6 2016-07-10 Fix log message if otr message is empty (thx spikeh1)
# v1.5 2015-09-17 Added OTR (Off the Record) end to end encryption
# Added MUC (Multi-User-Channel) joining and handling
@ -87,7 +88,7 @@ Jabber_Initialize($)
$hash->{DefFn} = "Jabber_Define";
$hash->{UndefFn} = "Jabber_UnDef";
$hash->{AttrFn} = "Jabber_Attr";
$hash->{AttrList} = "dummy:1,0 loglevel:0,1,2,3,4,5 OnlineStatus:available,unavailable PollTimer RecvWhitelist ResourceName MucJoin MucRecvWhitelist OTREnable OTRSharedSecret ".$readingFnAttributes;
$hash->{AttrList} = "dummy:1,0 loglevel:0,1,2,3,4,5 OnlineStatus:available,unavailable PollTimer RecvWhitelist ResourceName MucJoin MucRecvWhitelist OTREnable OTRSharedSecret JabberDomain ".$readingFnAttributes;
}
###################################
@ -303,6 +304,9 @@ Jabber_Attr(@)
}
} elsif ($aName eq "OTRSharedSecret") {
#Nothing special to do will be used later..
} elsif ($aName eq "JabberDomain" && $init_done) {
#restart connection...
$hash->{JabberDevice}->Disconnect();
}
}
return undef;
@ -546,13 +550,19 @@ sub Jabber_CheckConnection($)
}
if (!$hash->{JabberDevice}->Connected()) {
my $componentname = $hash->{helper}{server};
if(exists($attr{$name}{JabberDomain}) && $attr{$name}{JabberDomain} ne '') {
$componentname = $attr{$name}{JabberDomain};
}
my $connectionstatus = $hash->{JabberDevice}->Connect(
hostname=>$hash->{helper}{server},
port=>$hash->{helper}{port},
tls=>$hash->{helper}{tls},
ssl=>$hash->{helper}{ssl},
componentname=>$hash->{helper}{server}
componentname=>$componentname
);
if (!defined($connectionstatus)) {
@ -954,6 +964,9 @@ sub Jabber_OTR_disconnected {
=pod
=item device
=item summary connect FHEM to the Jabber Network, send and receiving messages
=item summary_DE verbindet FHEM and Jabber Netz, kann Nachrichten senden und empfangen
=begin html
<a name="Jabber"></a>