Add random string at the end of the default resource
When connecting for the first time or when creating a new account don't use only 'profanity' as default resource. Some server don't support having 2 connection with same resource. Using profanity as default lead to deconnections.
This commit is contained in:
@@ -173,7 +173,9 @@ session_connect_with_details(const char *const jid, const char *const passwd, co
|
||||
Jid *jidp = jid_create(jid);
|
||||
if (jidp->resourcepart == NULL) {
|
||||
jid_destroy(jidp);
|
||||
jidp = jid_create_from_bare_and_resource(jid, "profanity");
|
||||
char *resource = jid_random_resource();
|
||||
jidp = jid_create_from_bare_and_resource(jid, resource);
|
||||
free(resource);
|
||||
saved_details.jid = strdup(jidp->fulljid);
|
||||
} else {
|
||||
saved_details.jid = strdup(jid);
|
||||
|
||||
Reference in New Issue
Block a user