- Timestamp:
- 2015-01-26T02:43:34Z (10 years ago)
- Branches:
- master
- Children:
- fcb2c2e
- Parents:
- 8519f45
- git-author:
- dequis <dx@…> (20-07-14 06:28:49)
- git-committer:
- dequis <dx@…> (26-01-15 02:43:34)
- Location:
- protocols
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/bee_chat.c
r8519f45 rbe1efa3 80 80 } 81 81 82 static gboolean handle_is_self( struct im_connection *ic, const char *handle ) 83 { 84 return ( ic->acc->prpl->handle_is_self ) ? 85 ic->acc->prpl->handle_is_self( ic, handle ) : 86 ( ic->acc->prpl->handle_cmp( ic->acc->user, handle ) == 0 ); 87 } 88 82 89 void imcb_chat_msg( struct groupchat *c, const char *who, char *msg, uint32_t flags, time_t sent_at ) 83 90 { … … 89 96 90 97 /* Gaim sends own messages through this too. IRC doesn't want this, so kill them */ 91 if( g_strcasecmp( who, ic->acc->user ) == 0)98 if( handle_is_self( ic, who ) ) 92 99 return; 93 100 … … 139 146 if( who == NULL) 140 147 bu = NULL; 141 else if( g_strcasecmp( who, ic->acc->user ) == 0)148 else if( handle_is_self( ic, who ) ) 142 149 bu = bee->user; 143 150 else … … 161 168 imcb_log( c->ic, "User %s added to conversation %p", handle, c ); 162 169 163 me = ic->acc->prpl->handle_cmp( handle, ic->acc->user ) == 0;170 me = handle_is_self( ic, handle ); 164 171 165 172 /* Most protocols allow people to join, even when they're not in … … 189 196 190 197 /* It might be yourself! */ 191 if( g_strcasecmp( handle, ic->acc->user ) == 0)198 if( handle_is_self( ic, handle ) ) 192 199 { 193 200 if( c->joined == 0 ) -
protocols/jabber/iq.c
r8519f45 rbe1efa3 358 358 *s = '\0'; 359 359 jabber_set_me( ic, c->text ); 360 imcb_log( ic, "Server claims your JID is `%s' instead of `%s'. "361 "This mismatch may cause problems with groupchats "362 "and possibly other things.",363 c->text, ic->acc->user );364 360 if( s ) 365 361 *s = '/'; -
protocols/jabber/jabber.c
r8519f45 rbe1efa3 318 318 g_free( jd->oauth2_access_token ); 319 319 g_free( jd->away_message ); 320 g_free( jd->internal_jid ); 320 321 g_free( jd->username ); 321 322 g_free( jd->me ); … … 619 620 620 621 return NULL; 622 } 623 624 gboolean jabber_handle_is_self( struct im_connection *ic, const char *who ) { 625 struct jabber_data *jd = ic->proto_data; 626 return ( ( g_strcasecmp( who, ic->acc->user ) == 0 ) || 627 ( jd->internal_jid && 628 g_strcasecmp( who, jd->internal_jid ) == 0 ) ); 621 629 } 622 630 … … 648 656 ret->send_typing = jabber_send_typing; 649 657 ret->handle_cmp = g_strcasecmp; 658 ret->handle_is_self = jabber_handle_is_self; 650 659 ret->transfer_request = jabber_si_transfer_request; 651 660 ret->buddy_action_list = jabber_buddy_action_list; -
protocols/jabber/jabber.h
r8519f45 rbe1efa3 97 97 char *server; /* username@SERVER -=> server/domain, not hostname */ 98 98 char *me; /* bare jid */ 99 char *internal_jid; 99 100 100 101 const struct oauth2_service *oauth2_service; -
protocols/jabber/jabber_util.c
r8519f45 rbe1efa3 824 824 jd->username = g_strndup( jd->me, jd->server - jd->me ); 825 825 jd->server ++; 826 827 /* Set the "internal" account username, for groupchats */ 828 g_free( jd->internal_jid ); 829 jd->internal_jid = g_strdup( jd->me ); 826 830 827 831 return TRUE; -
protocols/nogaim.h
r8519f45 rbe1efa3 263 263 void *(* buddy_action) (struct bee_user *bu, const char *action, char * const args[], void *data); 264 264 265 /* If null, equivalent to handle_cmp( ic->acc->user, who ) */ 266 gboolean (* handle_is_self) (struct im_connection *, const char *who); 267 265 268 /* Some placeholders so eventually older plugins may cooperate with newer BitlBees. */ 266 269 void *resv1;
Note: See TracChangeset
for help on using the changeset viewer.