Mercurial > pidgin.yaz
comparison src/protocols/oscar/service.c @ 5917:a747e9e0e2cf
[gaim-migrate @ 6349]
2 compile fixes, one from a Herman mistake and one from a Luke-is-using-a-
different-version-of-gettext-that-doesn't-have-as-much-psycho-checking-of-
translation "mistake."
Also, I made it so "Send File" and "Direct IM" do not show up in the
right click menu unless the person is advertising that capability. This
probably should have been done a long time ago.
Also, some not-yet-used code for setting available messages. I'm working
on it. Oh, and I found a new capability in iChat. I don't know what it
does yet.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Wed, 18 Jun 2003 02:18:26 +0000 |
parents | da8939ad60b6 |
children | 1bebb8345bde |
comparison
equal
deleted
inserted
replaced
5916:a51b709b2b3e | 5917:a747e9e0e2cf |
---|---|
732 | 732 |
733 return 1; | 733 return 1; |
734 } | 734 } |
735 | 735 |
736 /* | 736 /* |
737 * Subtype 0x001e - Set Extended Status | 737 * Subtype 0x001e - Extended Status |
738 * | 738 * |
739 * Currently only works if using ICQ. | 739 * Sets your ICQ status (available, away, do not disturb, etc.) |
740 * | 740 * |
741 * These are the same TLVs seen in user info. You can | 741 * These are the same TLVs seen in user info. You can |
742 * also set 0x0008 and 0x000c. | 742 * also set 0x0008 and 0x000c. |
743 */ | 743 */ |
744 faim_export int aim_setextstatus(aim_session_t *sess, fu32_t status) | 744 faim_export int aim_setextstatus(aim_session_t *sess, fu32_t status) |
762 | 762 |
763 aim_addtlvtochain32(&tl, 0x0006, data); | 763 aim_addtlvtochain32(&tl, 0x0006, data); |
764 aim_writetlvchain(&fr->data, &tl); | 764 aim_writetlvchain(&fr->data, &tl); |
765 aim_freetlvchain(&tl); | 765 aim_freetlvchain(&tl); |
766 | 766 |
767 aim_tx_enqueue(sess, fr); | |
768 | |
769 return 0; | |
770 } | |
771 | |
772 /* | |
773 * Subtype 0x001e - Extended Status. | |
774 * | |
775 * Sets your "available" message. This is currently only supported by iChat | |
776 * and Gaim. | |
777 * | |
778 * These are the same TLVs seen in user info. You can | |
779 * also set 0x0008 and 0x000c. | |
780 */ | |
781 faim_export int aim_srv_setavailmsg(aim_session_t *sess, char *msg) | |
782 { | |
783 aim_conn_t *conn; | |
784 aim_frame_t *fr; | |
785 aim_snacid_t snacid; | |
786 | |
787 if (!sess || !(conn = aim_conn_findbygroup(sess, 0x0001))) | |
788 return -EINVAL; | |
789 | |
790 if (msg) { | |
791 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10 + 4 + strlen(msg) + 2))) | |
792 return -ENOMEM; | |
793 | |
794 snacid = aim_cachesnac(sess, 0x0001, 0x001e, 0x0000, NULL, 0); | |
795 aim_putsnac(&fr->data, 0x0001, 0x001e, 0x0000, snacid); | |
796 | |
797 aimbs_put16(&fr->data, 0x001d); | |
798 aimbs_put16(&fr->data, strlen(msg)+2); | |
799 aimbs_putraw(&fr->data, msg, strlen(msg)); | |
800 aimbs_put16(&fr->data, 0x0000); | |
801 } else { | |
802 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10 + 4 + 8))) | |
803 return -ENOMEM; | |
804 | |
805 snacid = aim_cachesnac(sess, 0x0001, 0x001e, 0x0000, NULL, 0); | |
806 aim_putsnac(&fr->data, 0x0001, 0x001e, 0x0000, snacid); | |
807 | |
808 aimbs_put16(&fr->data, 0x001d); | |
809 aimbs_put16(&fr->data, 0x0008); | |
810 aimbs_put16(&fr->data, 0x0002); | |
811 aimbs_put16(&fr->data, 0x0404); | |
812 aimbs_put16(&fr->data, 0x0000); | |
813 aimbs_put16(&fr->data, 0x0000); | |
814 } | |
815 | |
767 aim_tx_enqueue(sess, fr); | 816 aim_tx_enqueue(sess, fr); |
768 | 817 |
769 return 0; | 818 return 0; |
770 } | 819 } |
771 | 820 |
974 ret = userfunc(sess, rx, msg); | 1023 ret = userfunc(sess, rx, msg); |
975 free(msg); | 1024 free(msg); |
976 } break; | 1025 } break; |
977 } | 1026 } |
978 } | 1027 } |
979 return ret; | 1028 |
1029 return ret; | |
980 } | 1030 } |
981 | 1031 |
982 static int snachandler(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs) | 1032 static int snachandler(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs) |
983 { | 1033 { |
984 | 1034 |