- Timestamp:
- 2015-05-28T04:12:23Z (9 years ago)
- Children:
- d2d2b80
- Parents:
- ec8b369 (diff), 3d31618 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- protocols
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/presence.c
rec8b369 ra1d30c5 181 181 } 182 182 183 static char *choose_priority(struct im_connection *ic) 184 { 185 struct jabber_data *jd = ic->proto_data; 186 char *prio = set_getstr(&ic->acc->set, "priority"); 187 188 if (jd->away_state->code != NULL) { 189 int new_prio = (atoi(prio) - 5); 190 if (new_prio < 0) { 191 new_prio = 0; 192 } 193 return g_strdup_printf("%d", new_prio); 194 } 195 196 return g_strdup(prio); 197 } 198 183 199 /* Whenever presence information is updated, call this function to inform the 184 200 server. */ … … 189 205 GSList *l; 190 206 int st; 207 char *prio = choose_priority(ic); 191 208 192 209 node = jabber_make_packet("presence", NULL, NULL, NULL); 193 xt_add_child(node, xt_new_node("priority", set_getstr(&ic->acc->set, "priority"), NULL));210 xt_add_child(node, xt_new_node("priority", prio, NULL)); 194 211 if (jd->away_state) { 195 212 xt_add_child(node, xt_new_node("show", jd->away_state->code, NULL)); … … 222 239 223 240 xt_free_node(node); 241 g_free(prio); 224 242 return st; 225 243 } -
protocols/msn/msn.c
rec8b369 ra1d30c5 144 144 { 145 145 struct bee_user *bu = bee_user_by_handle(ic->bee, ic, who); 146 147 #ifdef DEBUG 148 if (strcmp(who, "raw") == 0) { 149 msn_ns_write(ic, -1, "%s\r\n", message); 150 return 0; 151 } 152 #endif 153 154 msn_ns_sendmessage(ic, bu, message); 155 return(0); 146 msn_ns_send_message(ic, bu, message); 147 return 0; 156 148 } 157 149 … … 277 269 return 0; 278 270 } else if (typing & OPT_TYPING) { 279 return (msn_buddy_msg(ic, who, TYPING_NOTIFICATION_MESSAGE, 0));271 return msn_ns_send_typing(ic, bu); 280 272 } else { 281 273 return 1; … … 338 330 339 331 g_tree_remove(md->domaintree, bu->handle); 340 }341 342 GList *msn_buddy_action_list(bee_user_t *bu)343 {344 static GList *ret = NULL;345 346 if (ret == NULL) {347 static const struct buddy_action ba[2] = {348 { "NUDGE", "Draw attention" },349 };350 351 ret = g_list_prepend(ret, (void *) ba + 0);352 }353 354 return ret;355 }356 357 void *msn_buddy_action(struct bee_user *bu, const char *action, char * const args[], void *data)358 {359 if (g_strcasecmp(action, "NUDGE") == 0) {360 msn_buddy_msg(bu->ic, bu->handle, NUDGE_MESSAGE, 0);361 }362 363 return NULL;364 332 } 365 333 … … 392 360 ret->buddy_data_add = msn_buddy_data_add; 393 361 ret->buddy_data_free = msn_buddy_data_free; 394 ret->buddy_action_list = msn_buddy_action_list;395 ret->buddy_action = msn_buddy_action;396 362 397 363 register_protocol(ret); -
protocols/msn/msn.h
rec8b369 ra1d30c5 26 26 #ifndef _MSN_H 27 27 #define _MSN_H 28 29 /* Some hackish magicstrings to make special-purpose messages/switchboards.30 */31 #define TYPING_NOTIFICATION_MESSAGE "\r\r\rBEWARE, ME R TYPINK MESSAGE!!!!\r\r\r"32 #define NUDGE_MESSAGE "\r\r\rSHAKE THAT THING\r\r\r"33 #define GROUPCHAT_SWITCHBOARD_MESSAGE "\r\r\rME WANT TALK TO MANY PEOPLE\r\r\r"34 35 #ifdef DEBUG_MSN36 #define debug(text ...) imcb_log(ic, text);37 #else38 #define debug(text ...)39 #endif40 28 41 29 /* This should be MSN Messenger 7.0.0813 … … 77 65 #define MSN_MESSAGE_HEADERS MSN_BASE_HEADERS \ 78 66 "Messaging: 2.0\r\n" \ 79 "Message-Type: Text\r\n" \67 "Message-Type: %s\r\n" \ 80 68 "Content-Length: %zd\r\n" \ 81 69 "Content-Type: text/plain; charset=UTF-8\r\n" \ … … 103 91 "</user>" 104 92 105 #define MSN_TYPING_HEADERS "MIME-Version: 1.0\r\n" \106 "Content-Type: text/x-msmsgscontrol\r\n" \107 "TypingUser: %s\r\n" \108 "\r\n\r\n"109 110 #define MSN_NUDGE_HEADERS "MIME-Version: 1.0\r\n" \111 "Content-Type: text/x-msnmsgr-datacast\r\n" \112 "\r\n" \113 "ID: 1\r\n" \114 "\r\n"115 116 93 #define PROFILE_URL "http://members.msn.com/" 117 94 … … 242 219 void msn_auth_got_contact_list(struct im_connection *ic); 243 220 int msn_ns_finish_login(struct im_connection *ic); 244 int msn_ns_sendmessage(struct im_connection *ic, struct bee_user *bu, const char *text); 221 int msn_ns_send_typing(struct im_connection *ic, struct bee_user *bu); 222 int msn_ns_send_message(struct im_connection *ic, struct bee_user *bu, const char *text); 245 223 int msn_ns_command(struct msn_data *md, char **cmd, int num_parts); 246 224 int msn_ns_message(struct msn_data *md, char *msg, int msglen, char **cmd, int num_parts); -
protocols/msn/ns.c
rec8b369 ra1d30c5 417 417 } else if (g_strncasecmp(ct, "text/x-msmsgsactivemailnotification", 35) == 0) { 418 418 /* Notification that a message has been read... Ignore it */ 419 } else {420 debug("Can't handle %s packet from notification server", ct);421 419 } 422 420 … … 623 621 char l[4]; 624 622 625 if ((bd->flags & 7) == 0 || (bd->flags & MSN_BUDDY_ADL_SYNCED)) {623 if ((bd->flags & (MSN_BUDDY_FL | MSN_BUDDY_AL)) == 0 || (bd->flags & MSN_BUDDY_ADL_SYNCED)) { 626 624 return FALSE; 627 625 } … … 641 639 } 642 640 643 g_snprintf(l, sizeof(l), "%d", bd->flags & 7);641 g_snprintf(l, sizeof(l), "%d", bd->flags & (MSN_BUDDY_FL | MSN_BUDDY_AL)); 644 642 c = xt_new_node("c", NULL, NULL); 645 643 xt_add_attr(c, "n", handle); … … 694 692 struct msn_buddy_data *bd = bu->data; 695 693 696 if (bu->ic != ic || (bd->flags & 7) == 0) {694 if (bu->ic != ic || (bd->flags & (MSN_BUDDY_FL | MSN_BUDDY_AL)) == 0) { 697 695 continue; 698 696 } … … 724 722 } 725 723 726 // TODO: typing notifications, nudges lol, etc 727 int msn_ns_sendmessage(struct im_connection *ic, bee_user_t *bu, const char *text) 724 static int msn_ns_send_sdg(struct im_connection *ic, bee_user_t *bu, const char *message_type, const char *text) 728 725 { 729 726 struct msn_data *md = ic->proto_data; … … 731 728 char *buf; 732 729 733 if (strncmp(text, "\r\r\r", 3) == 0) { 734 /* Err. Shouldn't happen but I guess it can. Don't send others 735 any of the "SHAKE THAT THING" messages. :-D */ 736 return 1; 737 } 738 739 buf = g_strdup_printf(MSN_MESSAGE_HEADERS, bu->handle, ic->acc->user, md->uuid, strlen(text), text); 730 buf = g_strdup_printf(MSN_MESSAGE_HEADERS, bu->handle, ic->acc->user, md->uuid, message_type, strlen(text), text); 740 731 retval = msn_ns_write(ic, -1, "SDG %d %zd\r\n%s", ++md->trId, strlen(buf), buf); 741 732 g_free(buf); 742 733 return retval; 743 734 } 735 736 int msn_ns_send_typing(struct im_connection *ic, bee_user_t *bu) 737 { 738 return msn_ns_send_sdg(ic, bu, "Control/Typing", ""); 739 } 740 741 int msn_ns_send_message(struct im_connection *ic, bee_user_t *bu, const char *text) 742 { 743 return msn_ns_send_sdg(ic, bu, "Text", text); 744 } 745 -
protocols/skype/Makefile
rec8b369 ra1d30c5 7 7 INSTALL = install 8 8 9 10 ifdef ASCIIDOC 11 MANPAGES = skyped.1 12 else 13 MANPAGES = 14 endif 15 16 all: $(MANPAGES) 17 9 all: 18 10 clean: 19 rm -f $(MANPAGES)20 11 21 12 # take this from the kernel … … 29 20 30 21 install-doc: doc 31 ifdef ASCIIDOC32 22 $(INSTALL) -d $(DESTDIR)$(MANDIR)/man1 33 23 $(INSTALL) -m644 $(MANPAGES) $(DESTDIR)$(MANDIR)/man1 34 endif35 24 36 25 uninstall-doc: … … 38 27 39 28 %.1: $(_SRCDIR_)%.txt $(_SRCDIR_)asciidoc.conf 40 a2x --asciidoc-opts="-f $(_SRCDIR_)asciidoc.conf" -a bee_date=$(DATE) -f manpage -D .$<29 a2x --asciidoc-opts="-f $(_SRCDIR_)asciidoc.conf" -a bee_date=$(DATE) -f manpage $<
Note: See TracChangeset
for help on using the changeset viewer.