mirror of
https://github.com/ChronosX88/psyced.git
synced 2024-11-08 19:41:00 +00:00
jabber/user: fixed outgoing presence support (announce)
This commit is contained in:
parent
85c3ee031d
commit
beeea117bf
@ -3921,4 +3921,4 @@ archetype
|
||||
+ when joe says "/nick joe" it is understood as removing the /nick
|
||||
jabber/user
|
||||
- fixed major bug in output of presence state (showFriends)
|
||||
|
||||
- fixed outgoing presence support (announce)
|
||||
|
@ -19,7 +19,8 @@ volatile int isplacemsg;
|
||||
|
||||
volatile int hasroster = 0; // client has requested roster
|
||||
|
||||
volatile mapping affiliations = ([ ]); // hack to support affiliations
|
||||
volatile mapping jabber2avail,
|
||||
affiliations = ([ ]); // hack to support affiliations
|
||||
|
||||
#include JABBER_PATH "disco.c"
|
||||
// #include NET_PATH "members.i" // isn't this include redundant?
|
||||
@ -30,6 +31,11 @@ qResource() { return resource; }
|
||||
|
||||
qHasCurrentPlace() { return 0; }
|
||||
|
||||
void create() {
|
||||
jabber2avail = shared_memory("jabber2avail");
|
||||
return ::create();
|
||||
}
|
||||
|
||||
/* it should be posible to do some things in a way that can be shared between
|
||||
* user and active/gateway... mostly stuff like MUC-support, version requests
|
||||
* and such -- TODO
|
||||
@ -400,32 +406,16 @@ presence(XMLNode node) {
|
||||
}
|
||||
} /* end of directed presence handling */
|
||||
#endif // _flag_disable_presence_directed_XMPP
|
||||
#ifdef AVAILABILITY_AWAY
|
||||
else if (node["/show"]) {
|
||||
// else this is one of the so-called "presence broadcasts"
|
||||
// we will never support stupid broadcasts although we could
|
||||
// do some fancy castmsg now
|
||||
switch (node["/show"][Cdata]) {
|
||||
case "away":
|
||||
case "xa":
|
||||
case "dnd":
|
||||
// we simply map them to away
|
||||
vSet("me", (node["/status"] &&
|
||||
node["/status"][Cdata]) || "away");
|
||||
announce(AVAILABILITY_AWAY);
|
||||
break;
|
||||
case "chat":
|
||||
// chattativ? ab in den flirt-raum mit dir!
|
||||
break;
|
||||
default:
|
||||
// away loeschen wenn gesetzt
|
||||
break;
|
||||
}
|
||||
} else if (node["@type"] == "unavailable") {
|
||||
// hey... we should logout those guys ;)
|
||||
else if (node["@type"] == "unavailable") {
|
||||
// announce OFFLINE manually here? no.. see comment in person:quit()
|
||||
// _flag_enable_manual_announce_XMPP is nothing we really need.. i think
|
||||
return quit();
|
||||
}
|
||||
#ifdef AVAILABILITY_AWAY
|
||||
else if (node["/show"]) {
|
||||
// this is one of the so-called "presence broadcasts"
|
||||
announce(jabber2avail[node["/show"] && node["/show"][Cdata]], 0, 0,
|
||||
node["/status"] && node["/status"][Cdata]);
|
||||
} else {
|
||||
// TODO: quiet?
|
||||
announce(AVAILABILITY_HERE);
|
||||
|
Loading…
Reference in New Issue
Block a user