Mercurial > ~mikael > mcabber > hg
comparison mcabber/mcabber/xmpp.c @ 1972:45f0f0f60656
Remove deprecated status invisible
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Sat, 19 Mar 2011 13:06:23 +0100 |
parents | 5d718766d2d6 |
children | e6beab22099b |
comparison
equal
deleted
inserted
replaced
1971:7ea4342044ef | 1972:45f0f0f60656 |
---|---|
486 } | 486 } |
487 } | 487 } |
488 #endif | 488 #endif |
489 | 489 |
490 xmpp_send_msg_no_chatstates: | 490 xmpp_send_msg_no_chatstates: |
491 #ifdef WITH_DEPRECATED_STATUS_INVISIBLE | |
491 if (mystatus != invisible) | 492 if (mystatus != invisible) |
493 #endif | |
492 update_last_use(); | 494 update_last_use(); |
493 if (xep184 && *xep184) { | 495 if (xep184 && *xep184) { |
494 lm_connection_send_with_reply(lconnection, x, *xep184, NULL); | 496 lm_connection_send_with_reply(lconnection, x, *xep184, NULL); |
495 lm_message_handler_unref(*xep184); | 497 lm_message_handler_unref(*xep184); |
496 } else | 498 } else |
1929 | 1931 |
1930 // Only send the packet if we're online. | 1932 // Only send the packet if we're online. |
1931 // (But we want to update internal status even when disconnected, | 1933 // (But we want to update internal status even when disconnected, |
1932 // in order to avoid some problems during network failures) | 1934 // in order to avoid some problems during network failures) |
1933 if (isonline) { | 1935 if (isonline) { |
1936 #ifdef WITH_DEPRECATED_STATUS_INVISIBLE | |
1934 const char *s_msg = (st != invisible ? msg : NULL); | 1937 const char *s_msg = (st != invisible ? msg : NULL); |
1938 #else | |
1939 // XXX Could be removed if/when we get rid of status invisible | |
1940 // completely. | |
1941 const char *s_msg = msg; | |
1942 #endif | |
1935 m = lm_message_new_presence(st, recipient, s_msg); | 1943 m = lm_message_new_presence(st, recipient, s_msg); |
1936 xmpp_insert_entity_capabilities(m->node, st); // Entity Caps (XEP-0115) | 1944 xmpp_insert_entity_capabilities(m->node, st); // Entity Caps (XEP-0115) |
1937 #ifdef HAVE_GPGME | 1945 #ifdef HAVE_GPGME |
1938 if (!do_not_sign && gpg_enabled()) { | 1946 if (!do_not_sign && gpg_enabled()) { |
1939 char *signature; | 1947 char *signature; |
1953 // If we didn't change our _global_ status, we are done | 1961 // If we didn't change our _global_ status, we are done |
1954 if (recipient) return; | 1962 if (recipient) return; |
1955 | 1963 |
1956 if (isonline) { | 1964 if (isonline) { |
1957 // Send presence to chatrooms | 1965 // Send presence to chatrooms |
1958 if (st != invisible) { | 1966 #ifdef WITH_DEPRECATED_STATUS_INVISIBLE |
1967 if (st != invisible) | |
1968 #endif | |
1969 { | |
1959 struct T_presence room_presence; | 1970 struct T_presence room_presence; |
1960 room_presence.st = st; | 1971 room_presence.st = st; |
1961 room_presence.msg = msg; | 1972 room_presence.msg = msg; |
1962 foreach_buddy(ROSTER_TYPE_ROOM, &roompresence, &room_presence); | 1973 foreach_buddy(ROSTER_TYPE_ROOM, &roompresence, &room_presence); |
1963 } | 1974 } |
1968 // we don't know the presences of buddies when offline... | 1979 // we don't know the presences of buddies when offline... |
1969 if (mystatus == offline || st == offline) | 1980 if (mystatus == offline || st == offline) |
1970 update_roster = TRUE; | 1981 update_roster = TRUE; |
1971 | 1982 |
1972 if (isonline || mystatus || st) | 1983 if (isonline || mystatus || st) |
1984 #ifdef WITH_DEPRECATED_STATUS_INVISIBLE | |
1973 hk_mystatuschange(0, mystatus, st, (st != invisible ? msg : "")); | 1985 hk_mystatuschange(0, mystatus, st, (st != invisible ? msg : "")); |
1986 #else | |
1987 hk_mystatuschange(0, mystatus, st, msg); | |
1988 #endif | |
1974 mystatus = st; | 1989 mystatus = st; |
1975 } | 1990 } |
1976 | 1991 |
1977 if (st) | 1992 if (st) |
1978 mywantedstatus = st; | 1993 mywantedstatus = st; |