Changeset 9624fdf
- Timestamp:
- 2007-04-17T04:49:17Z (18 years ago)
- Branches:
- master
- Children:
- 33dc261
- Parents:
- 717e3bf
- Location:
- protocols
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/message.c
r717e3bf r9624fdf 76 76 77 77 if( fullmsg->len > 0 ) 78 serv_got_im( ic, bud ? bud->bare_jid : from, fullmsg->str, 0, 0, fullmsg->len);78 imcb_buddy_msg( ic, bud ? bud->bare_jid : from, fullmsg->str, 0, 0 ); 79 79 80 80 g_string_free( fullmsg, TRUE ); … … 84 84 { 85 85 bud->flags |= JBFLAG_DOES_XEP85; 86 serv_got_typing( ic, bud ? bud->bare_jid : from, 0, 1);86 imcb_buddy_typing( ic, bud ? bud->bare_jid : from, OPT_TYPING ); 87 87 } 88 88 /* No need to send a "stopped typing" signal when there's a message. */ … … 90 90 { 91 91 bud->flags |= JBFLAG_DOES_XEP85; 92 serv_got_typing( ic, bud ? bud->bare_jid : from, 0, 0 );92 imcb_buddy_typing( ic, bud ? bud->bare_jid : from, 0 ); 93 93 } 94 94 else if( xt_find_node( node->children, "paused" ) ) 95 95 { 96 96 bud->flags |= JBFLAG_DOES_XEP85; 97 serv_got_typing( ic, bud ? bud->bare_jid : from, 0, 2);97 imcb_buddy_typing( ic, bud ? bud->bare_jid : from, OPT_THINKING ); 98 98 } 99 99 -
protocols/msn/sb.c
r717e3bf r9624fdf 607 607 if( sb->who ) 608 608 { 609 serv_got_im( ic, cmd[1], body, 0, 0, blen);609 imcb_buddy_msg( ic, cmd[1], body, 0, 0 ); 610 610 } 611 611 else if( sb->chat ) … … 666 666 if( sb->who ) 667 667 { 668 serv_got_im( ic, cmd[1], buf, 0, 0, strlen( buf ));668 imcb_buddy_msg( ic, cmd[1], buf, 0, 0 ); 669 669 } 670 670 else if( sb->chat ) … … 683 683 if( who ) 684 684 { 685 serv_got_typing( ic, who, 5, 1);685 imcb_buddy_typing( ic, who, OPT_TYPING ); 686 686 g_free( who ); 687 687 } -
protocols/nogaim.c
r717e3bf r9624fdf 424 424 if( !u ) 425 425 return( NULL ); 426 426 427 427 memset( b, 0, sizeof( b ) ); 428 428 strncpy( b->name, handle, 80 ); … … 575 575 { 576 576 irc_write( ic->irc, ":%s MODE %s %cv %s", ic->irc->myhost, 577 578 } 579 } 580 581 void serv_got_im( struct im_connection *ic, char *handle, char *msg, guint32 flags, time_t mtime, gint len)577 ic->irc->channel, u->away?'-':'+', u->nick ); 578 } 579 } 580 581 void imcb_buddy_msg( struct im_connection *ic, char *handle, char *msg, u_int32_t flags, time_t sent_at ) 582 582 { 583 583 irc_t *irc = ic->irc; … … 657 657 } 658 658 659 void serv_got_typing( struct im_connection *ic, char *handle, int timeout, int type)659 void imcb_buddy_typing( struct im_connection *ic, char *handle, u_int32_t flags ) 660 660 { 661 661 user_t *u; … … 664 664 return; 665 665 666 if( ( u = user_findhandle( ic, handle ) ) ) { 667 /* If type is: 668 * 0: user has stopped typing 669 * 1: user is actively typing 670 * 2: user has entered text, but is not actively typing 671 */ 672 if (type == 0 || type == 1 || type == 2) { 673 char buf[256]; 674 g_snprintf(buf, 256, "\1TYPING %d\1", type); 675 irc_privmsg( ic->irc, u, "PRIVMSG", ic->irc->nick, NULL, buf ); 676 } 666 if( ( u = user_findhandle( ic, handle ) ) ) 667 { 668 char buf[256]; 669 670 g_snprintf( buf, 256, "\1TYPING %d\1", ( flags >> 8 ) & 3 ); 671 irc_privmsg( ic->irc, u, "PRIVMSG", ic->irc->nick, NULL, buf ); 677 672 } 678 673 } -
protocols/nogaim.h
r717e3bf r9624fdf 50 50 #define BUF_LEN MSG_LEN 51 51 52 #define SELF_ALIAS_LEN 40053 52 #define BUDDY_ALIAS_MAXLEN 388 /* because MSN names can be 387 characters */ 54 53 … … 56 55 #define GAIM_AWAY_CUSTOM "Custom" 57 56 58 /* Sharing flags between buddies and connections. Or planning to, at least... */ 57 /* Sharing flags between all kinds of things. I just hope I won't hit any 58 limits before 32-bit machines become extinct. ;-) */ 59 59 #define OPT_LOGGED_IN 0x00000001 60 60 #define OPT_LOGGING_OUT 0x00000002 61 61 #define OPT_AWAY 0x00000004 62 62 #define OPT_DOES_HTML 0x00000010 63 #define OPT_TYPING 0x00000100 64 #define OPT_THINKING 0x00000200 63 65 64 66 /* ok. now the fun begins. first we create a connection structure */ … … 136 138 void (* set_away) (struct im_connection *, char *state, char *message); 137 139 void (* get_away) (struct im_connection *, char *who); 138 int (* send_typing) (struct im_connection *, char *who, int typing);140 int (* send_typing) (struct im_connection *, char *who, int flags); 139 141 140 142 /* For now BitlBee doesn't really handle groups, just set it to NULL. */ … … 171 173 }; 172 174 173 #define UC_UNAVAILABLE 1174 175 175 /* im_api core stuff. */ 176 176 void nogaim_init(); … … 208 208 G_MODULE_EXPORT void imcb_buddy_status( struct im_connection *ic, const char *handle, int flags, const char *state, const char *message ); 209 209 /* Not implemented yet! */ G_MODULE_EXPORT void imcb_buddy_times( struct im_connection *ic, const char *handle, time_t login, time_t idle ); 210 G_MODULE_EXPORT void serv_got_im( struct im_connection *ic, char *handle, char *msg, guint32 flags, time_t mtime, gint len);211 G_MODULE_EXPORT void serv_got_typing( struct im_connection *ic, char *handle, int timeout, int type);210 G_MODULE_EXPORT void imcb_buddy_msg( struct im_connection *ic, char *handle, char *msg, u_int32_t flags, time_t sent_at ); 211 G_MODULE_EXPORT void imcb_buddy_typing( struct im_connection *ic, char *handle, u_int32_t flags ); 212 212 213 213 /* Actions, or whatever. */ -
protocols/oscar/oscar.c
r717e3bf r9624fdf 1070 1070 1071 1071 strip_linefeed(tmp); 1072 serv_got_im(ic, userinfo->sn, tmp, flags, time(NULL), -1);1072 imcb_buddy_msg(ic, userinfo->sn, tmp, flags, 0); 1073 1073 g_free(tmp); 1074 1074 … … 1167 1167 message = g_strdup(args->msg); 1168 1168 strip_linefeed(message); 1169 serv_got_im(ic, uin, message, 0, time(NULL), -1);1169 imcb_buddy_msg(ic, uin, message, 0, 0); 1170 1170 g_free(uin); 1171 1171 g_free(message); … … 1186 1186 1187 1187 strip_linefeed(message); 1188 serv_got_im(ic, uin, message, 0, time(NULL), -1);1188 imcb_buddy_msg(ic, uin, message, 0, 0); 1189 1189 g_free(uin); 1190 1190 g_free(m); … … 1748 1748 g_snprintf(sender, sizeof(sender), "%u", msg->sender); 1749 1749 strip_linefeed(dialog_msg); 1750 serv_got_im(ic, sender, dialog_msg, 0, t, -1);1750 imcb_buddy_msg(ic, sender, dialog_msg, 0, t); 1751 1751 g_free(dialog_msg); 1752 1752 } break; … … 1769 1769 1770 1770 strip_linefeed(dialog_msg); 1771 serv_got_im(ic, sender, dialog_msg, 0, t, -1);1771 imcb_buddy_msg(ic, sender, dialog_msg, 0, t); 1772 1772 g_free(dialog_msg); 1773 1773 g_free(m); … … 2421 2421 if(type2 == 0x0002) { 2422 2422 /* User is typing */ 2423 serv_got_typing(ic, sn, 0, 1);2423 imcb_buddy_typing(ic, sn, OPT_TYPING); 2424 2424 } 2425 2425 else if (type2 == 0x0001) { 2426 2426 /* User has typed something, but is not actively typing (stale) */ 2427 serv_got_typing(ic, sn, 0, 2);2427 imcb_buddy_typing(ic, sn, OPT_THINKING); 2428 2428 } 2429 2429 else { 2430 2430 /* User has stopped typing */ 2431 serv_got_typing(ic, sn, 0, 0);2431 imcb_buddy_typing(ic, sn, 0); 2432 2432 } 2433 2433 -
protocols/yahoo/yahoo.c
r717e3bf r9624fdf 618 618 char *m = byahoo_strip( msg ); 619 619 620 serv_got_im( ic, (char*) who, (char*) m, 0, 0, strlen( m ));620 imcb_buddy_msg( ic, (char*) who, (char*) m, 0, 0 ); 621 621 g_free( m ); 622 622 } … … 634 634 { 635 635 struct im_connection *ic = byahoo_get_ic_by_id( id ); 636 if (stat == 1) { 637 /* User is typing */ 638 serv_got_typing( ic, (char*) who, 1, 1 ); 639 } 640 else { 641 /* User stopped typing */ 642 serv_got_typing( ic, (char*) who, 1, 0 ); 643 } 636 637 if( stat == 1 ) 638 imcb_buddy_typing( ic, (char*) who, OPT_TYPING ); 639 else 640 imcb_buddy_typing( ic, (char*) who, 0 ); 644 641 } 645 642
Note: See TracChangeset
for help on using the changeset viewer.