Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/ahtavarasmus/lightfriend
/ functions
Functions
2,907 in github.com/ahtavarasmus/lightfriend
⨍
Functions
2,907
◇
Types & classes
857
↓ 763 callers
Method
get
(&self, name: &str)
backend/src/tools/registry.rs:120
↓ 612 callers
Method
as_str
(&self)
backend/src/channels/traits.rs:53
↓ 276 callers
Method
execute
(&self, ctx: ToolContext<'_>)
backend/src/tools/email.rs:43
↓ 211 callers
Method
get
Create a GET request with automatic credentials and backend URL
frontend/src/utils/api.rs:193
↓ 193 callers
Method
send
( &self, _user: &User, address: &str, body: &str, media: Option<MediaR
backend/src/channels/sinch_channel.rs:72
↓ 183 callers
Method
json
Set the request body as JSON
frontend/src/utils/api.rs:58
↓ 171 callers
Method
send
Send the request with automatic token refresh and retry on 401
frontend/src/utils/api.rs:67
↓ 141 callers
Function
create_test_user
Create a test user in the database from TestUserParams
backend/src/test_utils.rs:247
↓ 139 callers
Function
create_test_state
Create a minimal AppState for testing credit deduction This creates a real in-memory database with UserCore and UserRepository, but stubs out OAuth c
backend/src/test_utils.rs:120
↓ 110 callers
Method
header
Add a header to the request
frontend/src/utils/api.rs:44
↓ 106 callers
Method
load
(content_dir: &str)
backend/src/blog/content.rs:92
↓ 62 callers
Method
find_by_id
(&self, user_id: i32)
backend/src/repositories/user_core.rs:294
↓ 61 callers
Method
post
Create a POST request with automatic credentials and backend URL
frontend/src/utils/api.rs:198
↓ 51 callers
Function
process_sms
( state: &Arc<AppState>, payload: TwilioWebhookPayload, mut options: ProcessSmsOptions, )
backend/src/api/twilio_sms.rs:433
↓ 51 callers
Method
register
(&mut self, handler: Arc<dyn ToolHandler>)
backend/src/tools/registry.rs:101
↓ 47 callers
Method
get_room
(&self, room_id: &str)
backend/src/api/matrix_client.rs:202
↓ 46 callers
Method
to_response
Convert to full ChatCompletionResponse for use with ProcessSmsOptions::test_with_mock()
backend/src/test_utils.rs:444
↓ 41 callers
Method
get_bridge
(&self, user_id: i32, service: &str)
backend/src/repositories/user_repository.rs:1263
↓ 40 callers
Method
send_to_user
Send a message to a user. Tries providers in priority order (`pick_channels_for`) and falls through to the next on send failure. The first attempt sen
backend/src/channels/router.rs:128
↓ 37 callers
Method
user_id
(&self)
backend/src/api/matrix_client.rs:216
↓ 35 callers
Method
send
( &self, _user: &User, _address: &str, _body: &str, _media: Option<Med
backend/tests/channels_router_test.rs:34
↓ 34 callers
Function
get_cached_client
Return the Matrix client for `user_id`, building one on demand if none is live. Semantically equivalent to `ensure_matrix_user_running` - kept as a se
backend/src/utils/matrix_auth.rs:880
↓ 32 callers
Method
build
()
backend/src/ontology/registry.rs:134
↓ 32 callers
Method
create_event
(&self, event: &NewOntEvent)
backend/src/repositories/ontology_repository.rs:2045
↓ 32 callers
Method
find_by_id
(&self, user_id: i32)
backend/src/test_utils.rs:838
↓ 31 callers
Method
insert_message
Insert a message into ont_messages with two layers of dedup. Returns `(row, is_new)`. When `is_new` is false, the returned row is a pre-existing dupl
backend/src/repositories/ontology_repository.rs:1050
↓ 28 callers
Function
log
(msg: str)
scripts/imap_idle_stress.py:73
↓ 28 callers
Method
with_last_activity
(mut self, ts: i64)
backend/src/api/matrix_client.rs:628
↓ 28 callers
Method
with_members
(mut self, members: Vec<RoomMember>)
backend/src/api/matrix_client.rs:623
↓ 26 callers
Function
get_country_code_from_phone
Get ISO country code from any phone number worldwide. Uses libphonenumber which handles US vs CA area code detection automatically.
backend/src/utils/country.rs:12
↓ 26 callers
Method
into_response
(self)
backend/src/handlers/auth_middleware.rs:258
↓ 25 callers
Method
ensure_user_settings_exist
Helper function to ensure user settings exist
backend/src/repositories/user_core.rs:654
↓ 25 callers
Method
into_response
Convert to the standard response tuple
backend/src/api/twilio_sms.rs:94
↓ 24 callers
Function
parse_digest_times
Parse and normalize a custom digest time string. Accepts comma-separated `HH:MM` values (or bare `HH` which is treated as `HH:00`). Each time is snap
backend/src/jobs/scheduler.rs:1180
↓ 23 callers
Method
handle_new_subscription
Handle a new subscription for a Stripe customer. Called when `CustomerSubscriptionCreated` event is received and no existing user is found by `stripe
backend/src/services/signup_service.rs:104
↓ 22 callers
Function
decrypt
Decrypts a string that was encrypted using AES-GCM # Arguments `encrypted` - The encrypted string in base64 format # Returns The decrypted string
backend/src/utils/encryption.rs:66
↓ 22 callers
Method
display_name
Get the effective nickname: user edit override, or base name
backend/src/models/ontology_models.rs:424
↓ 22 callers
Method
get_user_info
Get user_info, ensuring it exists first (PG)
backend/src/repositories/user_core.rs:495
↓ 21 callers
Method
body
Extract the body text from the message content
backend/src/api/matrix_client.rs:72
↓ 21 callers
Function
verify
Verify every `[id=N]` cited in `response` against `valid_ids` and produce both a user-facing and a history-bound version of the text. See [`VerifiedRe
backend/src/utils/id_verifier.rs:115
↓ 20 callers
Function
remove_bridge_suffix
(chat_name: &str)
backend/src/utils/bridge.rs:228
↓ 20 callers
Method
room_id
(&self)
backend/src/api/matrix_client.rs:235
↓ 20 callers
Method
with_rooms
(mut self, rooms: Vec<MockRoom>)
backend/src/api/matrix_client.rs:514
↓ 19 callers
Method
delete_bridge
(&self, user_id: i32, service: &str)
backend/src/repositories/user_repository.rs:1251
↓ 19 callers
Function
encrypt
Encrypts a string using AES-GCM encryption # Arguments `value` - The string to encrypt # Returns The encrypted string in base64 format
backend/src/utils/encryption.rs:34
↓ 18 callers
Function
insert_classified_message
( state: &std::sync::Arc<backend::AppState>, user_id: i32, room_id: &str, sender: &str, co
backend/tests/digest_layout_test.rs:554
↓ 18 callers
Method
log_usage
log the usage. activity_type either 'call' or 'sms', or the new 'notification' NOTE: User existence verification removed - users table is in SQLite, n
backend/src/repositories/user_repository.rs:491
↓ 17 callers
Function
setup_test_env
Set up environment variables for testing
backend/tests/twilio_message_service_test.rs:17
↓ 17 callers
Method
update_message_classification
Update a message's classification (urgency, category, summary) after LLM evaluation.
backend/src/repositories/ontology_repository.rs:1754
↓ 17 callers
Method
with_vehicle
(mut self, vehicle: TeslaVehicle)
backend/src/api/tesla_client.rs:286
↓ 16 callers
Function
create_test_service
Create a TwilioMessageService with MockTwilioClient for testing
backend/tests/twilio_message_service_test.rs:39
↓ 16 callers
Function
hash
(raw: &str)
backend/tests/webhook_sms_test.rs:27
↓ 16 callers
Function
match_email_sender_to_person
Pure helper: given a sender's envelope `from` email address and display name, attempt to match it to one of the user's ontology Persons via the email
backend/src/handlers/imap_handlers.rs:315
↓ 16 callers
Function
tesla_error_redirect
Helper to create error redirect for OAuth callback failures
backend/src/handlers/tesla_auth.rs:95
↓ 16 callers
Function
user_with_phone
(phone: &str)
backend/tests/channels_router_test.rs:50
↓ 15 callers
Function
decode
(code: &str)
backend/src/utils/twilio_error_codes.rs:31
↓ 15 callers
Method
get_user_settings
User settings operations
backend/src/repositories/user_core.rs:508
↓ 14 callers
Method
create_person
Create a Person manually (user action). Returns the new Person.
backend/src/repositories/ontology_repository.rs:318
↓ 14 callers
Function
create_test_vehicle
Helper function to create test vehicle data (no cfg(test) so it's available to integration tests)
backend/src/api/tesla_client.rs:596
↓ 14 callers
Function
ensure_current_included_usage_window
( state: &Arc<AppState>, user: &crate::models::user_models::User, )
backend/src/utils/usage.rs:39
↓ 14 callers
Method
get_calls
(&self)
backend/src/test_utils.rs:828
↓ 14 callers
Method
get_persons_with_channels
Get all Persons with their Channels and edits for a user.
backend/src/repositories/ontology_repository.rs:422
↓ 14 callers
Function
use_seo
(meta: SeoMeta)
frontend/src/utils/seo.rs:13
↓ 13 callers
Method
create_link
( &self, user_id: i32, source_type: &str, source_id: i32, target_type:
backend/src/repositories/ontology_repository.rs:941
↓ 13 callers
Method
find_by_phone_number
(&self, phone_number: &str)
backend/src/repositories/user_core.rs:303
↓ 13 callers
Function
probe_bridge_room
Send a read-only command to a bridge management room and collect responses from the bridge bot that arrived AFTER the command was sent. Filters by ori
backend/src/utils/bridge.rs:3246
↓ 12 callers
Function
any_active_subscription
()
backend/stripe_webhook_logic/src/lib.rs:202
↓ 12 callers
Method
delete
(&self, country_code: &str)
backend/src/repositories/provider_routes_repository.rs:54
↓ 12 callers
Method
get_youtube_tokens
( &self, user_id: i32, )
backend/src/repositories/user_repository.rs:807
↓ 12 callers
Function
handle_query
Handle a query_* ontology tool call. Returns formatted text for the LLM.
backend/src/tools/ontology.rs:7
↓ 11 callers
Function
check_synapse_health
Check if Synapse is healthy
backend/tests/bridge_integration_test.rs:333
↓ 11 callers
Method
process_status_callback
Process a status callback from Twilio. This handles: 1. Updating the message status in the database 2. Sending admin notifications on failure 3. Fetc
backend/src/services/twilio_status_service.rs:122
↓ 11 callers
Function
register_test_user
Helper to register a test user via Synapse admin API
backend/tests/bridge_integration_test.rs:43
↓ 11 callers
Method
resolve_credentials
Resolve Twilio credentials for a user. Credential resolution logic: 1. BYOT users always use their own credentials 2. Everyone else uses Lightfriend'
backend/src/services/twilio_message_service.rs:104
↓ 11 callers
Method
set_imap_credentials
Insert or update IMAP credentials for a user and return the `imap_connection.id` of the row (needed so callers can spawn a per-connection IDLE task).
backend/src/repositories/user_repository.rs:174
↓ 11 callers
Function
verify_twilio_signature
Pure function: verify a Twilio webhook signature using HMAC-SHA1. This implements Twilio's signature scheme: 1. Concatenate the full URL with the sor
backend/src/api/twilio_utils.rs:48
↓ 10 callers
Function
create_room
Helper to create a room
backend/tests/bridge_integration_test.rs:117
↓ 10 callers
Method
find_person_by_name
Find a Person by name (case-insensitive, checks both base name and nickname edits).
backend/src/repositories/ontology_repository.rs:609
↓ 10 callers
Method
get_all_imap_credentials
Get all active IMAP connections for a user
backend/src/repositories/user_repository.rs:291
↓ 10 callers
Method
get_pending_messages_by_urgency
Generalized digest fetcher used for the sectioned digest layout. Pulls undelivered, unresolved messages from the user matching any of the given urgenc
backend/src/repositories/ontology_repository.rs:1815
↓ 10 callers
Function
get_service_rooms_trait
Get service rooms using the trait interface (testable version)
backend/src/utils/bridge.rs:450
↓ 10 callers
Method
has_active_tesla
Tesla repository methods
backend/src/repositories/user_repository.rs:968
↓ 10 callers
Method
is_byot_user
Check if user has enabled routing through their own Twilio account.
backend/src/repositories/user_core.rs:1451
↓ 10 callers
Function
send_notification
( state: &Arc<AppState>, user_id: i32, notification: &str, content_type: String, first_mes
backend/src/proactive/utils.rs:210
↓ 10 callers
Function
test_message
Helper to create a test message
backend/tests/bridge_test.rs:485
↓ 9 callers
Method
add_message
Add a message to the mock repository.
backend/src/repositories/mock_twilio_status_repository.rs:52
↓ 9 callers
Method
body
Set the request body
frontend/src/utils/api.rs:50
↓ 9 callers
Method
create
Insert a new token row. Caller supplies the SHA-256 hash and the short prefix; the raw token never reaches this layer.
backend/src/repositories/webhook_tokens_repository.rs:62
↓ 9 callers
Method
create_message_history
( &self, new_message: &crate::pg_models::NewPgMessageHistory, )
backend/src/repositories/user_repository.rs:121
↓ 9 callers
Function
create_test_service
( repo: Arc<MockTwilioStatusRepository>, client: Arc<MockTwilioClient>, )
backend/tests/twilio_status_service_test.rs:31
↓ 9 callers
Function
deduct_from_twilio_price
Deduct credits based on actual Twilio price from StatusCallback. Called when Twilio reports the final cost of an SMS. Price is always in USD from Twil
backend/src/utils/usage.rs:342
↓ 9 callers
Function
fetch_bridge_messages_trait
Fetch bridge messages using the trait interface (testable version)
backend/src/utils/bridge.rs:580
↓ 9 callers
Method
get_commands
(&self)
backend/src/api/tesla_client.rs:311
↓ 9 callers
Function
insert_email_into_ontology
Insert an email preview into `ont_messages` and emit an ontology change event so rules can react. Idempotent: if a message with the same `email_<uid>`
backend/src/handlers/imap_handlers.rs:378
↓ 9 callers
Function
invite_to_room
Helper to invite a user to a room
backend/tests/bridge_integration_test.rs:161
↓ 9 callers
Function
log_fail
(msg: str)
scripts/imap_idle_stress.py:86
↓ 9 callers
Function
refresh_youtube_token
Refresh the YouTube access token using the refresh token
backend/src/handlers/youtube.rs:16
↓ 9 callers
Method
update_event_status
( &self, user_id: i32, event_id: i32, status: &str, )
backend/src/repositories/ontology_repository.rs:2151
↓ 9 callers
Function
wait_for_member
Helper to wait for a user to join a room
backend/tests/bridge_integration_test.rs:308
↓ 9 callers
Method
with_messages
(mut self, messages: Vec<crate::utils::bridge::BridgeMessage>)
backend/src/api/matrix_client.rs:613
next →
1–100 of 2,907, ranked by callers