]> git.draconx.ca Git - gentoo-draconx.git/blob - net-im/bitlbee/files/bitlbee-3.0.1-msn-unfuck.patch
xf86-video-intel: Remove ebuild.
[gentoo-draconx.git] / net-im / bitlbee / files / bitlbee-3.0.1-msn-unfuck.patch
1 === modified file 'protocols/msn/msn.c'
2 --- protocols/msn/msn.c 2010-11-19 21:00:14 +0000
3 +++ protocols/msn/msn.c 2010-12-12 00:25:17 +0000
4 @@ -107,6 +107,8 @@
5                         md->groups = g_slist_remove( md->groups, mg );
6                 }
7                 
8 +               g_free( md->profile_rid );
9 +               
10                 g_tree_destroy( md->domaintree );
11                 md->domaintree = NULL;
12                 
13 @@ -321,21 +323,15 @@
14         struct im_connection *ic = acc->ic;
15         struct msn_data *md = ic->proto_data;
16         
17 -       if( strlen( value ) > 129 )
18 -       {
19 -               imcb_log( ic, "Maximum name length exceeded" );
20 -               return NULL;
21 -       }
22 -       
23 -       if( md->flags & MSN_GOT_PROFILE_DN )
24 -               imcb_log( ic, "Warning: Persistent name changes for this account have to be done "
25 -                             "in the profile. BitlBee doesn't currently support this." );
26 -       
27         if( md->flags & MSN_EMAIL_UNVERIFIED )
28                 imcb_log( ic, "Warning: Your e-mail address is unverified. MSN doesn't allow "
29                               "changing your display name until your e-mail address is verified." );
30         
31 -       msn_soap_addressbook_set_display_name( ic, value );
32 +       if( md->flags & MSN_GOT_PROFILE_DN )
33 +               msn_soap_profile_set_dn( ic, value );
34 +       else
35 +               msn_soap_addressbook_set_display_name( ic, value );
36 +       
37         return msn_ns_set_display_name( ic, value ) ? value : NULL;
38  }
39  
40 @@ -362,7 +358,7 @@
41         struct prpl *ret = g_new0(struct prpl, 1);
42         
43         ret->name = "msn";
44 -    ret->mms = 1409;         /* this guess taken from libotr UPGRADING file */
45 +       ret->mms = 1409;         /* this guess taken from libotr UPGRADING file */
46         ret->login = msn_login;
47         ret->init = msn_init;
48         ret->logout = msn_logout;
49
50 === modified file 'protocols/msn/msn.h'
51 --- protocols/msn/msn.h 2010-11-13 13:01:40 +0000
52 +++ protocols/msn/msn.h 2010-12-12 00:25:17 +0000
53 @@ -118,6 +118,7 @@
54         
55         const struct msn_away_state *away_state;
56         GSList *groups;
57 +       char *profile_rid;
58         
59         /* Mostly used for sending the ADL command; since MSNP13 the client
60            is responsible for downloading the contact list and then sending
61
62 === modified file 'protocols/msn/soap.c'
63 --- protocols/msn/soap.c        2010-11-20 15:39:58 +0000
64 +++ protocols/msn/soap.c        2010-12-12 00:25:17 +0000
65 @@ -397,7 +397,10 @@
66                 return MSN_SOAP_RETRY;
67         
68         if( md->soapq )
69 +       {
70 +               md->flags &= ~MSN_REAUTHING; 
71                 return msn_soapq_flush( ic, TRUE );
72 +       }
73         
74         if( sd->secret == NULL )
75         {
76 @@ -1071,8 +1074,20 @@
77         return XT_HANDLED;
78  }
79  
80 +static xt_status msn_soap_profile_get_rid( struct xt_node *node, gpointer data )
81 +{
82 +       struct msn_soap_req_data *soap_req = data;
83 +       struct msn_data *md = soap_req->ic->proto_data;
84 +       
85 +       g_free( md->profile_rid );
86 +       md->profile_rid = g_strdup( node->text );
87 +       
88 +       return XT_HANDLED;
89 +}
90 +
91  static const struct xt_handler_entry msn_soap_profile_get_parser[] = {
92         { "ExpressionProfile", "GetProfileResult", msn_soap_profile_get_result },
93 +       { "ResourceID",        "GetProfileResult", msn_soap_profile_get_rid },
94         { NULL,               NULL,     NULL                        }
95  };
96  
97 @@ -1100,3 +1115,40 @@
98                                msn_soap_profile_get_handle_response,
99                                msn_soap_profile_get_free_data );
100  }
101 +
102 +/* Update profile (display name). */
103 +static int msn_soap_profile_set_dn_build_request( struct msn_soap_req_data *soap_req )
104 +{
105 +       struct msn_data *md = soap_req->ic->proto_data;
106 +       
107 +       soap_req->url = g_strdup( SOAP_STORAGE_URL );
108 +       soap_req->action = g_strdup( SOAP_PROFILE_SET_DN_ACTION );
109 +       soap_req->payload = g_markup_printf_escaped( SOAP_PROFILE_SET_DN_PAYLOAD,
110 +               md->tokens[3], md->profile_rid, (char*) soap_req->data );
111 +       
112 +       return 1;
113 +}
114 +
115 +static const struct xt_handler_entry msn_soap_profile_set_dn_parser[] = {
116 +       { NULL,               NULL,     NULL                        }
117 +};
118 +
119 +static int msn_soap_profile_set_dn_handle_response( struct msn_soap_req_data *soap_req )
120 +{
121 +       return MSN_SOAP_OK;
122 +}
123 +
124 +static int msn_soap_profile_set_dn_free_data( struct msn_soap_req_data *soap_req )
125 +{
126 +       g_free( soap_req->data );
127 +       return 0;
128 +}
129 +
130 +int msn_soap_profile_set_dn( struct im_connection *ic, const char *dn )
131 +{
132 +       return msn_soap_start( ic, g_strdup( dn ),
133 +                              msn_soap_profile_set_dn_build_request,
134 +                              msn_soap_profile_set_dn_parser,
135 +                              msn_soap_profile_set_dn_handle_response,
136 +                              msn_soap_profile_set_dn_free_data );
137 +}
138
139 === modified file 'protocols/msn/soap.h'
140 --- protocols/msn/soap.h        2010-10-02 06:56:33 +0000
141 +++ protocols/msn/soap.h        2010-12-12 00:25:17 +0000
142 @@ -302,6 +302,7 @@
143  
144  #define SOAP_STORAGE_URL "https://storage.msn.com/storageservice/SchematizedStore.asmx"
145  #define SOAP_PROFILE_GET_ACTION "http://www.msn.com/webservices/storage/w10/GetProfile"
146 +#define SOAP_PROFILE_SET_DN_ACTION "http://www.msn.com/webservices/storage/w10/UpdateProfile"
147  
148  #define SOAP_PROFILE_GET_PAYLOAD \
149  "<?xml version=\"1.0\" encoding=\"utf-8\"?>" \
150 @@ -344,7 +345,34 @@
151    "</soap:Body>" \
152  "</soap:Envelope>"
153  
154 +#define SOAP_PROFILE_SET_DN_PAYLOAD \
155 +"<?xml version=\"1.0\" encoding=\"utf-8\"?>" \
156 +"<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" \
157 +  "<soap:Header xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" \
158 +    "<StorageApplicationHeader xmlns=\"http://www.msn.com/webservices/storage/w10\">" \
159 +      "<ApplicationID>Messenger Client 9.0</ApplicationID>" \
160 +      "<Scenario>Initial</Scenario>" \
161 +    "</StorageApplicationHeader>" \
162 +    "<StorageUserHeader xmlns=\"http://www.msn.com/webservices/storage/w10\">" \
163 +      "<Puid>0</Puid>" \
164 +      "<TicketToken>%s</TicketToken>" \
165 +    "</StorageUserHeader>" \
166 +  "</soap:Header>" \
167 +  "<soap:Body xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" \
168 +    "<UpdateProfile xmlns=\"http://www.msn.com/webservices/storage/w10\">" \
169 +      "<profile>" \
170 +        "<ResourceID>%s</ResourceID>" \
171 +        "<ExpressionProfile>" \
172 +          "<FreeText>Update</FreeText>" \
173 +          "<DisplayName>%s</DisplayName>" \
174 +          "<Flags>0</Flags>" \
175 +        "</ExpressionProfile>" \
176 +      "</profile>" \
177 +    "</UpdateProfile>" \
178 +  "</soap:Body>" \
179 +"</soap:Envelope>"
180 +
181  int msn_soap_profile_get( struct im_connection *ic, const char *cid );
182 -
183 +int msn_soap_profile_set_dn( struct im_connection *ic, const char *dn );
184  
185  #endif /* __SOAP_H__ */
186