Changeset 6b83632 in Renga
- Timestamp:
- Dec 23, 2023, 2:57:52 PM (5 months ago)
- Branches:
- main
- Children:
- fadc861f
- Parents:
- 3d47039
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
jabber/JabberSpeak.cpp
r3d47039 r6b83632 114 114 const std::string JabberSpeak::CurrentRealName() const { 115 115 return _curr_realname; 116 }117 118 const std::string JabberSpeak::CurrentLogin() const {119 return _curr_login;120 116 } 121 117 -
jabber/JabberSpeak.h
r3d47039 r6b83632 79 79 // SELECTORS 80 80 const std::string CurrentRealName() const; 81 const std::string CurrentLogin() const;82 81 83 82 // gloox::ConnectionListener -
jabber/TalkManager.cpp
r3d47039 r6b83632 614 614 615 615 // FIXME send a message to the view instead (locking and unlocking for every message is slow) 616 window->LockLooper(); 616 bool isLocked = window->LockLooper(); 617 617 618 618 619 // TODO: compare with JID instead? … … 622 623 window->AddToTalk(group_username, runs, TalkView::MAIN_RECIPIENT, highlight, autoHyperlink); 623 624 624 window->UnlockLooper(); 625 // May not be locked if the view is not added to a winow yet 626 if (isLocked) 627 window->UnlockLooper(); 625 628 } 626 629 } … … 646 649 647 650 // FIXME just send a BMessage to the view and let it handle this 648 window->LockLooper();651 bool isLocked = window->LockLooper(); 649 652 window->SetStatus(subject); 650 653 std::list<TextSpan> runs; 651 654 runs.emplace_back(topic, TalkView::SystemMessagesStyle()); 652 655 window->AddToTalk(nick, runs, TalkView::OTHER, false, true); 653 window->UnlockLooper(); 656 if (isLocked) 657 window->UnlockLooper(); 654 658 } 655 659 -
ui/MainWindow.cpp
r3d47039 r6b83632 267 267 // we just logged in 268 268 BString statusText; 269 statusText.SetToFormat(B_TRANSLATE("Connected as %s"), JabberSpeak::Instance()->Current Login().c_str());269 statusText.SetToFormat(B_TRANSLATE("Connected as %s"), JabberSpeak::Instance()->CurrentRealName().c_str()); 270 270 _status_view->SetText(statusText.String()); 271 271 272 // save these settings 273 BlabberSettings::Instance()->SetData("last-realname", _login_realname->Text()); 274 BlabberSettings::Instance()->SetData("last-login", _login_username->Text()); 275 BlabberSettings::Instance()->RemoveData("last-password"); 276 277 BKeyStore keystore; 278 keystore.AddKeyring("XMPP"); 279 BPasswordKey key(_login_password->Text(), B_KEY_PURPOSE_GENERIC, _login_username->Text()); 280 status_t status = keystore.AddKey("XMPP", key); 281 if (status != B_OK) 282 fprintf(stderr, "failed to store password: %s\n", strerror(status)); 283 284 BlabberSettings::Instance()->SetTag("auto-login", _login_auto_login->Value()); 285 BlabberSettings::Instance()->WriteToFile(); 272 if (_login_username->TextLength() > 0) { 273 // save these settings 274 BlabberSettings::Instance()->SetData("last-realname", _login_realname->Text()); 275 BlabberSettings::Instance()->SetData("last-login", _login_username->Text()); 276 BlabberSettings::Instance()->RemoveData("last-password"); 277 278 BKeyStore keystore; 279 keystore.AddKeyring("XMPP"); 280 BPasswordKey key(_login_password->Text(), B_KEY_PURPOSE_GENERIC, _login_username->Text()); 281 status_t status = keystore.AddKey("XMPP", key); 282 if (status != B_OK) 283 fprintf(stderr, "failed to store password: %s\n", strerror(status)); 284 285 BlabberSettings::Instance()->SetTag("auto-login", _login_auto_login->Value()); 286 BlabberSettings::Instance()->WriteToFile(); 287 } 286 288 287 289 break; -
ui/TalkView.cpp
r3d47039 r6b83632 178 178 } else if (!uid || uid->UserType() == UserID::JABBER) { 179 179 // identify the user 180 sprintf(buffer, B_TRANSLATE("your identity is %s"), JabberSpeak::Instance()->Current Login().c_str());180 sprintf(buffer, B_TRANSLATE("your identity is %s"), JabberSpeak::Instance()->CurrentRealName().c_str()); 181 181 SetStatus(buffer); 182 182 } else { … … 560 560 std::string user = JabberSpeak::Instance()->CurrentRealName(); 561 561 562 // and if not :)563 if (user.empty())564 user = JabberSpeak::Instance()->CurrentLogin();565 566 562 return user; 567 563 }
Note:
See TracChangeset
for help on using the changeset viewer.